Bug #67354 MySql Cluster 7.3.0 Foreign Key Reference Table name case problem
Submitted: 24 Oct 2012 10:16 Modified: 9 Sep 2013 16:54
Reporter: Pavan Kumar Parankusam Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:7.3.0 OS:Windows (7, 64 bit)
Assigned to: CPU Architecture:Any
Tags: foreign key, reference table name case

[24 Oct 2012 10:16] Pavan Kumar Parankusam
Description:
Hi

I Installed MySqlCluster 7.3.0 (Development release) on windows environment as it enables foreign key constraints for ndbcluster engine.

My database is created using ndbcluster engine.

System variable
lower_case_table_names=1

Inspite of this, I am not able to execute following statement

ALTER TABLE CMSPROPERTYDATA ADD FOREIGN KEY (CONTENTNODEID) REFERENCES UMBRACONODE (ID);

Following is the error code
Error Code: 155. No such table: '(null)'.

But when i change the case of references table name to lower case then the foreign key is created.

ALTER TABLE CMSPROPERTYDATA ADD FOREIGN KEY (CONTENTNODEID) REFERENCES umbraconode (ID);

These statements are not created by me, they are executed directly in database by a third party software, so i can't change the statements.

I read in mysql cluster documentation that on windows, the tables names are incase-sensitive.

How about tables names used in references column (eg. above alter statement)

Can somebody let me know a solution to this problem.

Thanks

How to repeat:
Create two tables with upper case names (say COUNTRY and TOWN) using engine ndbcluster on windows environment. 

COUNTRY- Columns
ID int
NAME varchar

TOWN- Columns
ID int
NAME varchar
COUNTRYID int

Create following foreign key constraint on table TOWN

ALTER TABLE TOWN ADD FOREIGN KEY (COUNTRYID) REFERENCES COUNTRY(ID);

Following is the error code
Error Code: 155. No such table: '(null)'.

When i change the statement to use lower case name for references table then it succeeds. 

ALTER TABLE TOWN ADD FOREIGN KEY (COUNTRYID) REFERENCES country(ID);
[7 Nov 2012 7:28] MySQL Verification Team
Thank you for the report.

Verified as described.
[9 Sep 2013 16:54] Jon Stephens
Documented fix in the NDB 7.3.3 changelog as follows:

        Setting lower_case_table_names to 1 or 2 on Windows systems
        caused ALTER TABLE ... ADD FOREIGN KEY statements against tables
        with names containing uppercase letters to fail with Error 155,
        No such table: '(null)'.

Closed.