Bug #100578 | mysqldiff messes the order of multiple PK if PK and fields are in diff. order | ||
---|---|---|---|
Submitted: | 19 Aug 2020 14:24 | Modified: | 20 Aug 2020 12:11 |
Reporter: | Julien Ricard | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Utilities | Severity: | S3 (Non-critical) |
Version: | 1.6.5 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | mysql utilities, mysqldiff |
[19 Aug 2020 14:24]
Julien Ricard
[19 Aug 2020 14:33]
Julien Ricard
Actually, my bug description is not correct. When I run the mysqldiff the first time, the sql that is generated contains this string for the ALTER : ADD PRIMARY KEY(`id`,`network_id`), The two fields are not in the correct order. Then, when I run the same command again, I get what I describe in the bug report.
[19 Aug 2020 14:38]
Julien Ricard
fixed the title of the bug report
[19 Aug 2020 16:21]
Julien Ricard
ok to add to this issue about primary key : - mysqldiff adds two DROP PRIMARY KEY in the SQL output when the PK is on multiple fields - mysqldiff tries to add the PRIMARY KEY with fields ordered not in the same way than the other base, putting them in alphabetical order : ALTER TABLE `db`.`the_table` DROP PRIMARY KEY, DROP PRIMARY KEY, ADD PRIMARY KEY(`id`,`network_id`); It should output : ALTER TABLE `db`.`the_table` DROP PRIMARY KEY, ADD PRIMARY KEY(`network_id`, `id`);
[19 Aug 2020 16:44]
Julien Ricard
ok I thought it was an alphabetical order, I have another table with a PK on 3 fields, and the result seems not correlated with any order I could understand. So it seems to be unreliable with the fields order, and the PK fields.
[20 Aug 2020 12:11]
MySQL Verification Team
Hi Mr. Ricard, Thank you for your bug report. I repeated your test case with standalone `mysqldiff` utility. Do note that this is a very low priority bug, since all this functionality will be soon moved to MySQL Shell. Verified as reported.