Bug #70248 mysqldiff is broken
Submitted: 5 Sep 2013 7:17 Modified: 5 Jan 2015 20:58
Reporter: Ricardo Oliveira Email Updates:
Status: No Feedback Impact on me:
Category:MySQL Utilities Severity:S1 (Critical)
Version:1.3.5 OS:Linux (ubuntu 12.04)
Assigned to: CPU Architecture:Any

[5 Sep 2013 7:17] Ricardo Oliveira
mysqldiff is completely broken, it produces drop keys and drop primary key statements when comparing two tables with exactly the same keys. It seems to get the new columns and alter column right, but it completely messes up on the KEY and PRIMARY KEY comparisons.

How to repeat:
just run mysqldiff with two different tables
[5 Sep 2013 12:42] Chuck Bell
Please provide an example so we can see how it is failing. Output from the mysqldiff run would be sufficient.
[6 Sep 2013 0:40] Ricardo Oliveira
Did you guys run this on linux and checked the output of mysqldiff? seems it was not tested (at least on ubuntu), this has been happening for quite a long time, and the mac version still has the same problem.

I just did this:
mysqldiff --server1=user:pass@server1 --server2=user:pass@server2 --difftype=sql db1:db2 --force --quiet

and it produces non-sense output like this:
ALTER TABLE `db`.`t1` 
  ADD PRIMARY KEY(`c1`,`c2`,`c3`), 
  CHANGE COLUMN c2 c2 binary(13) NOT NULL;

and it drops the indexes and recreates them even if they are exactly the same. In fact for the example above, the key it adds is exactly the same as the one it drops ;)

Just create a db with the same schemas and you'll see this.
[5 Dec 2014 20:58] Sveta Smirnova
Thank you for the report.

Please try with current version 1.5.3: I cannot repeat described behavior with this version.
[6 Jan 2015 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".