mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
Port r132 from branches/5.0: Port r15 from innodb-4.1:
Do not mistake TABLENAME_ibfk_0 for auto-generated id (Bug #16387). dict_table_get_highest_foreign_id(): Ignore foreign constraint identifiers starting with the pattern TABLENAME_ibfk_0. innodb.test, innodb.result: Add test case.
This commit is contained in:
@@ -2048,6 +2048,18 @@ select a,hex(b) from t1 order by b;
|
||||
update t1 set b = 'three' where a = 6;
|
||||
drop table t1;
|
||||
|
||||
# Ensure that <tablename>_ibfk_0 is not mistreated as a
|
||||
# generated foreign key identifier. (Bug #16387)
|
||||
|
||||
CREATE TABLE t1(a INT, PRIMARY KEY(a)) ENGINE=InnoDB;
|
||||
CREATE TABLE t2(a INT) ENGINE=InnoDB;
|
||||
ALTER TABLE t2 ADD FOREIGN KEY (a) REFERENCES t1(a);
|
||||
ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_1;
|
||||
ALTER TABLE t2 ADD CONSTRAINT t2_ibfk_0 FOREIGN KEY (a) REFERENCES t1(a);
|
||||
ALTER TABLE t2 DROP FOREIGN KEY t2_ibfk_0;
|
||||
SHOW CREATE TABLE t2;
|
||||
DROP TABLE t2,t1;
|
||||
|
||||
#
|
||||
# Test case for bug #16229: MySQL/InnoDB uses full explicit table locks in trigger processing
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user