diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-09-30 16:25:06 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-09-30 16:25:06 +0300 |
commit | 323500bfa9a8f80ca210f4a010ad6a4b5bba689d (patch) | |
tree | ee8c08b079183123099d3c94025aa475f85d2702 /mysql-test/suite | |
parent | 6cbbd6bd96a8b5c97ec4d0b687aac29fb0f63a6a (diff) | |
parent | cd5f4d2a5939aa047734f023b28462c65f3e4569 (diff) | |
download | mariadb-git-323500bfa9a8f80ca210f4a010ad6a4b5bba689d.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/suite')
-rw-r--r-- | mysql-test/suite/innodb/r/foreign_key.result | 14 | ||||
-rw-r--r-- | mysql-test/suite/innodb/t/foreign_key.test | 14 |
2 files changed, 28 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/r/foreign_key.result b/mysql-test/suite/innodb/r/foreign_key.result index 6ae396529ef..43cee8a6e6b 100644 --- a/mysql-test/suite/innodb/r/foreign_key.result +++ b/mysql-test/suite/innodb/r/foreign_key.result @@ -405,6 +405,20 @@ Opened_table_definitions 2 Opened_tables 2 drop function foo; drop table t2, t1; +CREATE TABLE t1 (pk INT, a INT, PRIMARY KEY (pk)) ENGINE=InnoDB; +XA START 'xid'; +INSERT INTO t1 VALUES (1,2); +CREATE TABLE x AS SELECT * FROM t1; +ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the ACTIVE state +connect con1,localhost,root,,test; +SET foreign_key_checks= OFF, innodb_lock_wait_timeout= 1; +ALTER TABLE t1 ADD FOREIGN KEY f (a) REFERENCES t1 (pk), LOCK=EXCLUSIVE; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +disconnect con1; +connection default; +XA END 'xid'; +XA ROLLBACK 'xid'; +DROP TABLE t1; # Start of 10.2 tests # # MDEV-13246 Stale rows despite ON DELETE CASCADE constraint diff --git a/mysql-test/suite/innodb/t/foreign_key.test b/mysql-test/suite/innodb/t/foreign_key.test index 9b9c639f86b..190461a4f7b 100644 --- a/mysql-test/suite/innodb/t/foreign_key.test +++ b/mysql-test/suite/innodb/t/foreign_key.test @@ -407,6 +407,20 @@ show status like '%opened_tab%'; drop function foo; drop table t2, t1; +CREATE TABLE t1 (pk INT, a INT, PRIMARY KEY (pk)) ENGINE=InnoDB; +XA START 'xid'; +INSERT INTO t1 VALUES (1,2); +--error ER_XAER_RMFAIL +CREATE TABLE x AS SELECT * FROM t1; +--connect (con1,localhost,root,,test) +SET foreign_key_checks= OFF, innodb_lock_wait_timeout= 1; +--error ER_LOCK_WAIT_TIMEOUT +ALTER TABLE t1 ADD FOREIGN KEY f (a) REFERENCES t1 (pk), LOCK=EXCLUSIVE;# Cleanup +--disconnect con1 +--connection default +XA END 'xid'; +XA ROLLBACK 'xid'; +DROP TABLE t1; # # End of 10.1 tests # |