distal-attribute
distal-attribute
distal-attribute
distal-attribute

Could not create foreign key using MySQL ndbcluster engine

P30n posted 3 months ago in General
Since 7.3 MySQL Cluster has foreign key support. Out company switched to ndbcluster and all developer using HeidiSQL for database mangement. It would be greate if it become possible to use HeidiSQL to create tables with foreign keys in the table editor.

The newest stable version says ndbcluster dont support foreign keys.

Version: 8.3.0.4694

Any plans to fix this?

ansgar posted 3 months ago
Of course, I can adjust that conditional.

I only need to know what the server version has to say in that case. So, what does SELECT VERSION() return?
P30n posted 3 months ago
5.6.17-ndb-7.3.5

It is supported since Version 7.3 (https://blogs.oracle.com/MySQL/entry/mysql_cluster_7_3_labs).
ansgar posted 3 months ago
Done in r4799
P30n posted 3 months ago
Nice - thank you!

Today i tried the build and i found two bugs. In the foreign fey-tab the reference table selection is empty if only ndbcluster tables exists. InnoDB tables appear but could not used in combination with ndbcluster tables (this is a mysql cluster restriction).

It works fine if i manually type in the name of the reference table - for now this is no problem for me. For some reason after the foreign key creation (the table contraints working as expected) the existing foreign key did not appear in the foreign tab (but as key in the indexes tab - which is right so far). Its not possible to edit an existing key (onDelete, onUpdate, rename and so on). Might be a problem with the query you use to retrieve all existing foreign keys for a table (not supported by mysql cluster)?

ansgar posted 3 months ago
HeidiSQL just parses the output of the "SHOW CREATE TABLE xyz" query. You could check whether the ndb cluster foreign keys show up there.

Please login to leave a reply, or register at first.