Could not create foreign key using MySQL ndbcluster engine

[expired user #8224]'s profile image [expired user #8224] posted 10 years ago in General Permalink
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's profile image ansgar posted 10 years ago Permalink
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?
[expired user #8224]'s profile image [expired user #8224] posted 10 years ago Permalink
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).
Code modification/commit from ansgar.becker, 10 years ago, revision 4799
Enable foreign keys editor on NDB cluster >= 7.3.x. See http://www.heidisql.com/forum.php?t=16059
ansgar's profile image ansgar posted 10 years ago Permalink
Done in r4799
[expired user #8224]'s profile image [expired user #8224] posted 10 years ago Permalink
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's profile image ansgar posted 10 years ago Permalink
HeidiSQL just parses the output of the "SHOW CREATE TABLE xyz" query. You could check whether the ndb cluster foreign keys show up there.
[expired user #9290]'s profile image [expired user #9290] posted 8 years ago Permalink
Hi,
This problem seems still not solved.
I'm using latest stable HeidiSQL 9.3.0 and my database is ndbcluster 7.3.5.

I can see foreign key constrains correctly on Toad for MySQL but not on HeidiSQL. In HeidiSQL show create does not shows constraints, only index (which come from the constraints).

Thanks in advance for this light and fast tool.
[expired user #9290]'s profile image [expired user #9290] posted 8 years ago Permalink
[quote=ansgar][/quote] Let me know if you need more details.

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