Bug #60523 Wrong names shown in "select changes to apply" step of model synchronization
Submitted: 18 Mar 2011 3:22 Modified: 17 Nov 2011 17:39
Reporter: Terry Nycum Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:5.2.33 OS:Windows (XP)
Assigned to: CPU Architecture:Any
Tags: case-sensitivity, synchronization, synchronize model

[18 Mar 2011 3:22] Terry Nycum
Description:
There appears to be a problem grabbing the strings for the names of entities existing on the database side for display at the "Select Changes to Apply" step of the Synchronize Model with Database wizard. If there are tables/views whose names differ only in case, the name of one of them is used for all of them.

Originally I thought the problem was in the actual logic that determines the entity mappings--that it was actually mapping entities case-insensitively and multiple times, but now I don't think that's the case:

Despite appearing to be under the impression that names have changed, affected mappings are not pre-selected for update when you arrive at that step. If those mappings are selected manually and then changes reviewed, the statement preview is empty. So the logic appears to know that no renaming is needed.

This is consistent with the empty report you'll see if you opt to Database > "generate catalog diff report" instead. This occurs regardless of whether the model or live instance is assigned to the left side of the comparison.

How to repeat:
Connect to a server that allows case-sensitive table names.

CREATE DATABASE test;
USE test;
CREATE TABLE AA (col1 TINYINT);
CREATE TABLE aa (col1 TINYINT);
CREATE VIEW BB AS (SELECT * FROM AA);
CREATE VIEW bb AS (SELECT * FROM aa);

Create EER model from existing database.
Select connection and schema `test`.
Leave both tables and both views selected.
Deselect "Place imported objects on a diagram".
Click 'execute'.
Database > Synchronize.
Select connection and schema `test`.
Leave both tables and both views selected.
Proceed to Model and Database Differences step.
Notice names displayed on database side.
Select all mappings and click "Update source".
Click Next.
Notice the empty statement set.
[18 Mar 2011 3:37] Terry Nycum
metadata update
[18 Mar 2011 3:39] Terry Nycum
Screenshot showing incorrect table names on database side.

Attachment: Synchronize_Model_with_Database-2011-03-17_19.52.07.png (image/png, text), 44.37 KiB.

[30 Mar 2011 17:26] MySQL Verification Team
Thank you for the bug report.
[17 Nov 2011 17:39] Philip Olson
Fixed as of 5.2.36:
+        The <literal>Syncronize model with Database</literal> wizard
+        would not properly handle case-sensitive table names.