Bug #76056 MysqlDiff: CREATE TABLE directive not generated
Submitted: 25 Feb 2015 19:15 Modified: 31 Jul 2015 8:21
Reporter: Jean-Marie Renouard (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Utilities Severity:S4 (Feature request)
Version:1.5.3, 1.5.4 OS:Any
Assigned to: CPU Architecture:Any
Tags: mysqldiff

[25 Feb 2015 19:15] Jean-Marie Renouard
Description:
Utilities: mysqldiff

When a table is missing in on server with --changes-for and --difftype=sql options, no SQL directives are generated when a table is missing in one of the two servers.

So, you can't generated a "full" diff script.
When table differs, it is ok but when table are missing, it's impossible to add missing tables or drop them. 

How to repeat:
Adding a table in database and not in the second server:
Create table emplinfo (a int primary key, infodata varchar(255));

Command line used:
mysqldiff --server1=root@localhost:3307 --server1=root@localhost:3308
--diff-type=sql --show-reverse --changes-for=server2  employees:employees

Result: 
WARNING: Objects in server1:employees but not in server2:emp1:
  EVENT: e1
Compare failed. One or more differences found.

But we don't have SQL directive to add or drop corresponding table.

Suggested fix:
When a table is missing in on server with --changes-for option :
- A Drop table directive should be generated.
or
- The content of "show create table" directive could be inserted in the report.
[31 Jul 2015 8:21] MySQL Verification Team
Hello Jean-Marie Renouard,

Thank you for the feature request!

Thanks,
Umesh