Comment 8 for bug 1364457

Revision history for this message
Valerii Kravchuk (valerii-kravchuk) wrote :

Upstream test case on non-debug build of Percona Server does not produce any assertion failure, just error:

mysql> create table t1(a int,key(a))engine=innodb;
Query OK, 0 rows affected (0.09 sec)

mysql> create table t2(a int,key(a))engine=innodb;
Query OK, 0 rows affected (0.10 sec)

mysql> create table t3(a int,key(a))engine=innodb;
Query OK, 0 rows affected (0.09 sec)

mysql> set foreign_key_checks=1;
Query OK, 0 rows affected (0.00 sec)

mysql> alter table `t3` add constraint `s` foreign key (`a`) references `t1`(`a`) on delete no action ;
Query OK, 0 rows affected (0.22 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> alter table `t1` add constraint `p` foreign key (`a`) references `t2`(`a`) on update set null ;
Query OK, 0 rows affected (0.22 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> alter table `t3` add constraint `s` foreign key (`a`) references `t1`(`a`) on update set null ;
ERROR 1005 (HY000): Can't create table 'test.#sql-2c22_3' (errno: 121)
mysql> alter table `t2` add constraint ` ip` foreign key (`a`) references `t1`(`a`) on update restrict;
Query OK, 0 rows affected (0.29 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> show global status like 'Uptime';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Uptime | 80185 |
+---------------+-------+
1 row in set (0.00 sec)

mysql> select version();
+-------------+
| version() |
+-------------+
| 5.5.39-36.0 |
+-------------+
1 row in set (0.00 sec)