After dumping a database on MySQL-5.1.73 and loading it into MySQL-5.5, I notice, that at least one table's primary key didn't have its auto_increment
flag transferred... The describe table
on the original reads thus:
+-----------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+----------------+
| FIELD_ID | bigint(20) | NO | | 0 | |
| ID | bigint(20) | NO | PRI | NULL | auto_increment |
| ISSUE_ID | bigint(20) | NO | MUL | 0 | |
| LOCK_HASH | varchar(255) | YES | MUL | NULL | |
| LOCK_TIME | bigint(20) | YES | | NULL | |
| RANK | varchar(255) | NO | MUL | NULL | |
| TYPE | int(11) | NO | | 0 | |
+-----------+--------------+------+-----+---------+----------------+
But, after loading into the target, the last column is empty -- auto_increment
flag of the ID
-field is gone.
Indeed, looking into the dump, I see the table's definition as:
CREATE TABLE "AO_60DB71_LEXORANK" (
"FIELD_ID" bigint(20) NOT NULL DEFAULT '0',
"ID" bigint(20) NOT NULL,
"ISSUE_ID" bigint(20) NOT NULL DEFAULT '0',
"LOCK_HASH" varchar(255) COLLATE utf8_bin DEFAULT NULL,
"LOCK_TIME" bigint(20) DEFAULT NULL,
"RANK" varchar(255) COLLATE utf8_bin NOT NULL,
"TYPE" int(11) NOT NULL DEFAULT '0',
PRIMARY KEY ("ID"),
KEY "index_ao_60db71_lexorank_rank" ("RANK"),
KEY "index_ao_60db71_lex604083109" ("ISSUE_ID"),
KEY "index_ao_60db71_lex1632828616" ("LOCK_HASH")
);
There is no obvious instruction to set ID to automatically increment... The non-default flags used with mysqldump
were:
extended-insert=false
compatible=postgres
single-transaction
Is this a known problem? Should I attempt a bug-report with MySQL (Oracle)?