Bug #88702 mysqldiff --difftype=sql not reporting corrent indexes differences
Submitted: 29 Nov 2017 21:43 Modified: 30 Nov 2017 6:59
Reporter: mark gruenberg Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Utilities Severity:S2 (Serious)
Version:1.6.5 OS:Any
Assigned to: CPU Architecture:Any
Tags: mysqldiff, SQL

[29 Nov 2017 21:43] mark gruenberg
Description:
mysqldiff is not reporting the correct ddl to synchronize differences with indexes

How to repeat:
mysql> create table t1 (c1 varchar(10),c2 varchar(10),index c1 (c1,c2));
Query OK, 0 rows affected (0.10 sec)

mysql> create table t2 (c1 varchar(10),c2 varchar(10),index c1 (c1));
Query OK, 0 rows affected (0.10 sec)

mysqldiff --server1=mg_p2 --server2=mg_p2 --changes-for=server2 test.t1:test.t2 --force --skip-table-options --difftype=sql
# server1 on percdb2: ... connected.
# server2 on percdb2: ... connected.
# Comparing test.t1 to test.t2                                     [FAIL]
# Transformation for --changes-for=server2:
#

ALTER TABLE `test`.`t2`
  ADD INDEX c1 (c2);

# Compare failed. One or more differences found.

the correct difference should be

alter table test.t2 
  drop index c1,
  add index c1 (c1, c2);
[30 Nov 2017 6:59] MySQL Verification Team
Hello mark gruenberg,

Thank you for the report and test case.

Thanks,
Umesh