Bug #115248 Create tale bug in NDB cluster
Submitted: 7 Jun 2:34 Modified: 7 Jun 20:51
Reporter: CunDi Fang Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:8.0.35-cluster MySQL Cluster Community S OS:Any
Assigned to: MySQL Verification Team CPU Architecture:Any

[7 Jun 2:34] CunDi Fang
Description:
I have a problem when trying to build a table, firstly I created a test4 table:

Poc of table test4:
```
CREATE TABLE IF NOT EXISTS mydatabase.test4 (column0 INT AUTO_INCREMENT, column1 BOOLEAN, column2 FLOAT NOT NULL, column3 BOOLEAN NOT
 NULL UNIQUE, column4 FLOAT, column5 DATETIME NOT NULL UNIQUE, PRIMARY KEY (column0), UNIQUE (column3, column5) ) ENGINE=NDB; 
```

Then I try to build a table test9 and try to reference column0 of test4 as a foreign key:

Poc of table test9:
```
CREATE TABLE IF NOT EXISTS mydatabase.test9 (column0 INT AUTO_INCREMENT, column1 DATETIME, column2 VARCHAR(255), column3 DATETIME UNIQUE, column4 DATETIME, column5 BOOLEAN UNIQUE, PRIMARY KEY (column0), UNIQUE (column3, column5) , FOREIGN KEY (column0) REFERENCES mydatabase.test4(column0) ON DELETE RESTRICT ON UPDATE CASCADE) ENGINE=NDB;
```

Then I ran into this problem:
```
ERROR 1215 (HY000): Cannot add foreign key constraint
```

This shouldn't come up, should it?

How to repeat:
show in the description.

Suggested fix:
I have a feeling that the functionality is incompletely implemented, or that there are conflicts between components?
[7 Jun 20:51] MySQL Verification Team
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug.

For details on getting support for MySQL products see http://www.mysql.com/support/
You can also check our forums (free) at http://forums.mysql.com/

Thank you for your interest in MySQL.

Please check: https://dev.mysql.com/blog-archive/foreign-keys-in-mysql-cluster/