Error 1506 Hy000
Status: Verified Impact on me: None Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical) Version:7.1.9a OS:Linux (CentOS 5) Assigned to: Triage: Needs Triage: D3 mysql foreign key partitioned table (Medium) View Add Comment Files Developer Edit Submission View Progress Log Contributions error code 1506 foreign key clause is not yet supported in conjunction with partitioning [14 Dec 2010 21:43] Ryan Hansen Description: According to the documentation (http://dev.mysql.com/doc/refman/5.1/en/mysql-cluster-limitations-unsupported.html), the foreign key construct is supposed to be ignored "just as it is in MyISAM tables." However, this is not true. Attempts to create foreign keys result in the following error: ERROR 1506 (HY000): Foreign key clause is not yet supported in conjunction with partitioning NOTE: we are not intentionally attempting to create foreign keys on ndbcluster tables. This bug showed up when trying to run Django's syncdb command after having upgraded to MySQL Cluster 7.1.9a. The syncdb script automatically generates foreign key statements such as the following: ALTER TABLE `auth_group_permissions` ADD CONSTRAINT `permission_id_refs_id_a7792de1` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`); As far as I know, there is no way to tell syncdb *not* to try to create foreign keys; it simply expects them to be ignored on engines that do not support them. Either way, the same error results from trying to create a foreign key manually using the MySQL client, not only from Django (no big surprise there). This bug forced us to revert back to MySQL Cluster 7.0.6 for the time being, which does operate properly (foreign key constructs ignored). How to repeat: Create any two tables and try to create a foreign key constraint between them. Suggested fix: 1- Make foreign key constructs actually ignored, per documentation OR 2- Allow a config and/or run-time directive to activate "ignore foreign key statements" behavior [14 Dec 2010 22:06] Sveta Smirnova Thank you for the report. > ERROR 1506 (HY000): Foreign key clause is not yet supported in conjunction with partitioning Please send output of SHOW CREATE TABLE auth_group_permissions [14 Dec 2010 22:35] Ryan Hansen SHOW CREATE TABLE auth_group_permissions auth_group_permissions | CREATE TABLE `auth_group_permissions` ( `id` int(11) NOT
Montgomery Email Updates: Status: Closed Impact on me: None Category:MySQL Server: DDL Severity:S2 (Serious) Version:ndb-7.3.0 OS:Any Assigned to: View Add Comment Files Developer Edit Submission View Progress Log Contributions [6 Nov 2012 21:21] Matthew Montgomery Description: Currently InnoDB does not support foreign keys on partitioned tables. NDB has no such limitation. MySQL is incorrectly applying this rule preventing partitioned tables to have foreign keys against NDB also. However is doing so inconsistently causing a potential problem for restore. How https://bugs.mysql.com/bug.php?id=58929 to repeat: mysql> create table t1 (a int unsigned auto_increment primary key, b varchar(20)) engine=ndbcluster; create table t2 (a int unsigned auto_increment primary key, t1a int unsigned, b varchar(20), foreign key `fk1` (t1a) references t1 (a) on delete cascade) engine=ndbcluster partition by key () partitions 2; Query OK, 0 rows affected (0.26 sec) ERROR 1506 (HY000): Foreign http://bugs.mysql.com/67492 key clause is not yet supported in conjunction with partitioning
Message: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning Error: 1501 SQLSTATE: HY000 http://www.fromdual.com/mysql-error-codes-and-messages-1500-1549 (ER_CANT_CREATE_HANDLER_FILE) Message: Failed to create specific handler file Error: 1502 SQLSTATE: HY000 (ER_BLOB_FIELD_IN_PART_FUNC_ERROR) Message: A BLOB field is not allowed in partition function Error: 1503 SQLSTATE: HY000 (ER_UNIQUE_KEY_NEED_ALL_FIELDS_IN_PF) http://qatech.online/error-1506-sqlstate-hy000--erforeignkeyonpartitioned----message-foreign-key-clause-is-not-yet-supported-in-conjunction--with-partitioning/4216/ Message: A %s must include all columns in the table's partitioning function Error: 1504 SQLSTATE: HY000 (ER_NO_PARTS_ERROR) Message: Number of %s = 0 is not an allowed foreign key value Error: 1505 SQLSTATE: HY000 (ER_PARTITION_MGMT_ON_NONPARTITIONED) Message: Partition management on a not partitioned table is not possible Error: 1506 SQLSTATE: HY000 (ER_FOREIGN_KEY_ON_PARTITIONED) Message: Foreign key clause is not yet supported in conjunction with partitioning Error: 1507 SQLSTATE: HY000 (ER_DROP_PARTITION_NON_EXISTENT) Message: Error in list of partitions to %s Error: 1508 SQLSTATE: HY000 (ER_DROP_LAST_PARTITION) Message: Cannot error 1506 hy000 remove all partitions, use DROP TABLE instead Error: 1509 SQLSTATE: HY000 (ER_COALESCE_ONLY_ON_HASH_PARTITION) Message: COALESCE PARTITION can only be used on HASH/KEY partitions Error: 1510 SQLSTATE: HY000 (ER_REORG_HASH_ONLY_ON_SAME_NO) Message: REORGANIZE PARTITION can only be used to reorganize partitions not to change their numbers Error: 1511 SQLSTATE: HY000 (ER_REORG_NO_PARAM_ERROR) Message: REORGANIZE PARTITION without parameters can only be used on auto-partitioned tables using HASH PARTITIONs Error: 1512 SQLSTATE: HY000 (ER_ONLY_ON_RANGE_LIST_PARTITION) Message: %s PARTITION can only be used on RANGE/LIST partitions Error: 1513 SQLSTATE: HY000 (ER_ADD_PARTITION_SUBPART_ERROR) Message: Trying to Add partition(s) with wrong number of subpartitions Error: 1514 SQLSTATE: HY000 (ER_ADD_PARTITION_NO_NEW_PARTITION) Message: At least one partition must be added Error: 1515 SQLSTATE: HY000 (ER_COALESCE_PARTITION_NO_PARTITION) Message: At least one partition must be coalesced Error: 1516 SQLSTATE: HY000 (ER_REORG_PARTITION_NOT_EXIST) Message: More partitions to reorganize than there are partitions Error: 1517 SQLSTATE: HY000 (ER_SAME_NAME_PARTITION) Message: Duplicate partition name %s Error: 1518 SQLSTATE: HY000 (ER_NO_BINLOG_ERROR) Message: It is not allowed to shut off binlog on this command Error: 1519 SQ