Bug #67224 mysqldiff and mysqldbcompare fail to distinguish procedure and table
Submitted: 14 Oct 2012 3:50 Modified: 12 Jun 2013 6:49
Reporter: Yaroslav Fomenko Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Utilities Severity:S3 (Non-critical)
Version:5.2.44 CE OS:Windows
Assigned to: CPU Architecture:Any
Tags: mysqldbcompare, mysqldiff

[14 Oct 2012 3:50] Yaroslav Fomenko
Description:
If we have in a database a procedure and a table with the same name mysqldiff and mysqldbcompare only check one of the object types and fail to notice differences in the other.

In my case mysqldiff and mysqldbcompare only check the tables and fails to notice difference in the procedures.

How to repeat:
Run this script to create 2 schemata with a table and a procedure that have the same name. Note that the procedures are different.

delimiter ;;

create schema schema1;;
create table schema1.object (id int primary key);;
insert into schema1.object (id) values (1);;
create procedure schema1.object()
begin
	select 1;
end;;

create schema schema2;;
create table schema2.object (id int primary key);;
insert into schema2.object (id) values (1);;
create procedure schema2.object()
begin
	select 2;
end;;

Then run these commands in the command prompt:
cd /D "C:\Program Files (x86)\MySQL\MySQL Workbench 5.2 CE\utilities"
mysqldiff.exe --server1=root:2369@localhost schema1:schema2 --force --difftype=sql
mysqldbcompare.exe --server1=root:2369@localhost schema1:schema2 --run-all-tests --format=grid

Both of the utilities report no differences in the data but don't mention the differences in the procedures.

Suggested fix:
When comparing, take into account the type of the object (table, procedure etc) along with the name.
[15 Oct 2012 13:25] MySQL Verification Team
Thank you for the bug report.
[12 Jun 2013 6:49] Philip Olson
Fixed as of the upcoming MySQL Utilities 1.2.3 release, and here's the changelog entry:

The "mysqldiff" and "mysqldbcompare" utilities failed to find differences
when database objects had the same name with different types. Both the
type and name are now compared. The display messages were also improved.

Thank you for the bug report.