summaryrefslogtreecommitdiff
path: root/mysql-test/main/innodb_mysql_sync.result
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2022-03-01 13:01:48 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2022-03-01 13:01:48 +0530
commit446ec646511adf4327f9f5d9414fc4cb75c8161c (patch)
tree4d903e3208cf9c44f8ed1c92718cb882a255f8b1 /mysql-test/main/innodb_mysql_sync.result
parent3c58cdd91d86aa03d3a5204dbfea5948810e8bc9 (diff)
downloadmariadb-git-446ec646511adf4327f9f5d9414fc4cb75c8161c.tar.gz
MDEV-27962 Instant DDL downgrades the MDL when table is empty
- Server incorrectly downgrading the MDL after prepare phase when table is empty. mdl_exclusive_after_prepare is being set in prepare phase only. But mdl_exclusive_after_prepare condition was misplaced and checked before prepare phase by commit d270525dfde86bcb92a2327234a0954083e14a94 and it is now changed to check after prepare phase. - main.innodb_mysql_sync test case was changed to avoid locking optimization when table is empty.
Diffstat (limited to 'mysql-test/main/innodb_mysql_sync.result')
-rw-r--r--mysql-test/main/innodb_mysql_sync.result12
1 files changed, 8 insertions, 4 deletions
diff --git a/mysql-test/main/innodb_mysql_sync.result b/mysql-test/main/innodb_mysql_sync.result
index 3f284edde86..5e1f60d3e25 100644
--- a/mysql-test/main/innodb_mysql_sync.result
+++ b/mysql-test/main/innodb_mysql_sync.result
@@ -131,6 +131,7 @@ connection default;
DROP DATABASE db1;
# Test 2: Primary index (implicit), should block writes.
CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb;
+INSERT INTO t1 VALUES(1, 2);
SET DEBUG_SYNC= "alter_table_inplace_after_lock_downgrade SIGNAL manage WAIT_FOR query";
# Sending:
ALTER TABLE t1 ADD UNIQUE INDEX(a), LOCK=SHARED;
@@ -139,15 +140,16 @@ SET DEBUG_SYNC= "now WAIT_FOR manage";
USE test;
SELECT * FROM t1;
a b
+1 2
# Sending:
-UPDATE t1 SET a=NULL;
+UPDATE t1 SET a=3;
connection con2;
# Waiting for SELECT to be blocked by the metadata lock on t1
SET DEBUG_SYNC= "now SIGNAL query";
connection default;
# Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a)
connection con1;
-# Reaping: UPDATE t1 SET a=NULL
+# Reaping: UPDATE t1 SET a=3
# Test 3: Primary index (explicit), should block writes.
connection default;
ALTER TABLE t1 DROP INDEX a;
@@ -158,15 +160,16 @@ connection con1;
SET DEBUG_SYNC= "now WAIT_FOR manage";
SELECT * FROM t1;
a b
+3 2
# Sending:
-UPDATE t1 SET a=NULL;
+UPDATE t1 SET a=4;
connection con2;
# Waiting for SELECT to be blocked by the metadata lock on t1
SET DEBUG_SYNC= "now SIGNAL query";
connection default;
# Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a)
connection con1;
-# Reaping: UPDATE t1 SET a=NULL
+# Reaping: UPDATE t1 SET a=4
# Test 4: Secondary unique index, should not block reads.
connection default;
SET DEBUG_SYNC= "alter_table_inplace_after_lock_downgrade SIGNAL manage WAIT_FOR query";
@@ -176,6 +179,7 @@ connection con1;
SET DEBUG_SYNC= "now WAIT_FOR manage";
SELECT * FROM t1;
a b
+4 2
SET DEBUG_SYNC= "now SIGNAL query";
connection default;
# Reaping: ALTER TABLE t1 ADD UNIQUE (b)