Bug #73252 | Duplicate foreign keys break insertions to a table | ||
---|---|---|---|
Submitted: | 10 Jul 2014 7:18 | Modified: | 21 Aug 2014 8:55 |
Reporter: | Simon Mudd (OCA) | Email Updates: | |
Status: | No Feedback | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S3 (Non-critical) |
Version: | 5.6.13 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | foreign key, innodb |
[10 Jul 2014 7:18]
Simon Mudd
[21 Jul 2014 8:55]
MySQL Verification Team
Thank you for the report. I cannot repeat this behavior at my end with the similar test case. How often are you seeing this kind of errors triggered? Please could you provide the exact repeatable test case? Also, similar reported here Bug #69861 but caused by LAST_INSERT_ID.. Are you using LAST_INSERT_ID anywhere? ######## mysql> drop table if exists `t1`; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> drop table if exists `t2`; drop table if exists `t3`; create table t2(id int primary key)engine=innodb; create table t3(id int primary key)engine=innodb; Query OK, 0 rows affected (0.13 sec) mysql> drop table if exists `t3`; create table `t1` ( `a` int not null ,`b` int not null ,`c` date not null, `d` timestamp not null default current_timestamp on update current_timestamp, primary key (`a`,`b`,`c`), key(`b`), key(`c`), constraint `_t1_ibfk_1` foreign key (`a`) references `t2` (`id`), constraint `_t1_ibfk_2` foreign key (`b`) references `t3` (`id`), constraint `t1_ibfk_1` foreign key (`a`) references `t2` (`id`), constraint `t1_ibfk_2` foreign key (`b`) references `t3` (`id`) ) engine=innodb; insert into t2 values(1); Query OK, 0 rows affected (0.10 sec) mysql> create table t2(id int primary key)engine=innodb; insert into t3 values(1); insert into t1(a,b,c) values (1,1,'2014-07-10');Query OK, 0 rows affected (0.29 sec) mysql> create table t3(id int primary key)engine=innodb; Query OK, 0 rows affected (0.30 sec) mysql> mysql> create table `t1` ( -> `a` int not null -> ,`b` int not null -> ,`c` date not null, -> `d` timestamp not null default current_timestamp on update current_timestamp, -> primary key (`a`,`b`,`c`), -> key(`b`), -> key(`c`), -> constraint `_t1_ibfk_1` foreign key (`a`) references `t2` (`id`), -> constraint `_t1_ibfk_2` foreign key (`b`) references `t3` (`id`), -> constraint `t1_ibfk_1` foreign key (`a`) references `t2` (`id`), -> constraint `t1_ibfk_2` foreign key (`b`) references `t3` (`id`) -> ) engine=innodb; Query OK, 0 rows affected (0.40 sec) mysql> mysql> insert into t2 values(1); Query OK, 1 row affected (0.04 sec) mysql> insert into t3 values(1); Query OK, 1 row affected (0.03 sec) mysql> insert into t1(a,b,c) values (1,1,'2014-07-10'); Query OK, 1 row affected (0.02 sec) mysql> select * from t1; +---+---+------------+---------------------+ | a | b | c | d | +---+---+------------+---------------------+ | 1 | 1 | 2014-07-10 | 2014-07-23 04:58:42 | +---+---+------------+---------------------+ 1 row in set (0.00 sec)
[22 Aug 2014 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".