MySQL Forums
Forum List  »  NDB clusters

Re: ndb-7.5.5 : Foreignkey contraint failure returning incomplete error message
Posted by: Martin Sköld
Date: November 30, 2017 08:40AM

Hi!

Seems fixed in later versions, can't find exact matching bug fix, but there
are a couple in the change log.
I tried this in 7.6:

mysql> create table t1 (
-> a int not null,
-> primary key using hash (a)
-> ) engine ndb;
Query OK, 0 rows affected (0,52 sec)

mysql> insert into t1 values (1),(2);
Query OK, 2 rows affected (0,02 sec)
Records: 2 Duplicates: 0 Warnings: 0

mysql> create table t2 (
-> a int not null,
-> b int not null,
-> c int not null,
-> primary key using hash (a),
-> key xbc (b,c),
-> foreign key fk1 (b) references t1 (a) on delete set null
-> ) engine ndb;
Query OK, 0 rows affected (1,03 sec)

mysql> insert into t2 (a,b,c) values (1,1,11),(2,2,21),(3,2,22);
Query OK, 3 rows affected (0,00 sec)
Records: 3 Duplicates: 0 Warnings: 0

mysql> insert into t2 (a,b,c) values (4,3,33);
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `fk1` FOREIGN KEY (`b`) REFERENCES `t1` (`a`) ON DELETE SET NULL ON UPDATE NO ACTION)



Edited 2 time(s). Last edit at 11/30/2017 08:51AM by Martin Sköld.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: ndb-7.5.5 : Foreignkey contraint failure returning incomplete error message
525
November 30, 2017 08:40AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.