[Commits] a729656: MDEV-10548: Some of the debug sync waits do not work with InnoDB 5.7 (branch bb-10.2-jan)

Jan Lindström jan.lindstrom at mariadb.com
Wed Sep 14 11:30:02 EEST 2016


revision-id: a7296560064c50b2cc8b42e0ede4d3f9bb84f75a (mariadb-10.2.1-18-ga729656)
parent(s): da168b3405f8dddf317ce79339233ca5ed9c9aa3
committer: Jan Lindström
timestamp: 2016-09-14 11:28:40 +0300
message:

MDEV-10548: Some of the debug sync waits do not work with InnoDB 5.7 (branch bb-10.2-jan)

Fixed auto_increment_dup test. Current behavior is correct for repeatable read (and
serializable) isolation levels. Old behavior is correct for read committed
isolation level.

---
 mysql-test/suite/encryption/disabled.def           |   5 +-
 .../r/innodb_encryption-page-compression.result    |   4 +
 mysql-test/suite/innodb/disabled.def               |   1 -
 .../suite/innodb/r/auto_increment_dup.result       | 143 +++++++++++++++++++++
 mysql-test/suite/innodb/t/auto_increment_dup.opt   |   1 +
 mysql-test/suite/innodb/t/auto_increment_dup.test  | 130 +++++++++++++++++++
 6 files changed, 280 insertions(+), 4 deletions(-)

diff --git a/mysql-test/suite/encryption/disabled.def b/mysql-test/suite/encryption/disabled.def
index ae9359f..979a2a5 100644
--- a/mysql-test/suite/encryption/disabled.def
+++ b/mysql-test/suite/encryption/disabled.def
@@ -13,6 +13,5 @@
 innodb_scrub : MDEV-8139
 innodb_scrub_compressed : MDEV-8139
 innodb_scrub_background : MDEV-8139
-innodb_encryption-page-compression : Fails with lost connection at line 156
-innochecksum : Waiting for merge
-
+innochecksum : MDEV-10727
+innodb_encryption_discard_import : MDEV-9099
diff --git a/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result b/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result
index e323899..9523c7c 100644
--- a/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result
+++ b/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result
@@ -1,4 +1,6 @@
 SET GLOBAL innodb_file_format = `Barracuda`;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
 SET GLOBAL innodb_file_per_table = ON;
 SET GLOBAL innodb_encryption_threads = 4;
 SET GLOBAL innodb_encrypt_tables = on;
@@ -262,3 +264,5 @@ drop table innodb_page_compressed6;
 drop table innodb_page_compressed7;
 drop table innodb_page_compressed8;
 drop table innodb_page_compressed9;
+Warnings:
+Warning	131	Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
diff --git a/mysql-test/suite/innodb/disabled.def b/mysql-test/suite/innodb/disabled.def
index dd61889..1580474 100644
--- a/mysql-test/suite/innodb/disabled.def
+++ b/mysql-test/suite/innodb/disabled.def
@@ -10,5 +10,4 @@
 #
 ##############################################################################
 
-innodb.auto_increment_dup : MDEV-10548
 innodb_defragment_fill_factor : MDEV-10771
\ No newline at end of file
diff --git a/mysql-test/suite/innodb/r/auto_increment_dup.result b/mysql-test/suite/innodb/r/auto_increment_dup.result
index 25a0a07..bb4ee9b 100644
--- a/mysql-test/suite/innodb/r/auto_increment_dup.result
+++ b/mysql-test/suite/innodb/r/auto_increment_dup.result
@@ -1,4 +1,137 @@
 drop table if exists t1;
+set global transaction isolation level repeatable read;
+CREATE TABLE t1(
+id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+k INT,
+c CHAR(1),
+UNIQUE KEY(k)) ENGINE=InnoDB;
+SHOW CREATE TABLE t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `k` int(11) DEFAULT NULL,
+  `c` char(1) DEFAULT NULL,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY `k` (`k`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+#
+# Sequential execution
+#
+INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1';
+affected rows: 3
+info: Records: 3  Duplicates: 0  Warnings: 0
+#
+# 1 duplicate
+#
+INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
+affected rows: 4
+info: Records: 3  Duplicates: 1  Warnings: 0
+#
+# 5 rows, consecutive auto_inc values
+#
+SELECT * FROM t1 order by k;
+id	k	c
+1	1	NULL
+2	2	2
+3	3	NULL
+4	4	NULL
+5	5	NULL
+affected rows: 5
+DROP TABLE t1;
+affected rows: 0
+CREATE TABLE t1(
+id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+k INT,
+c CHAR(1),
+UNIQUE KEY(k)) ENGINE=InnoDB;
+affected rows: 0
+#
+# Sequential execution 2
+#
+INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
+affected rows: 3
+info: Records: 3  Duplicates: 0  Warnings: 0
+#
+# 1 duplicate
+#
+INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1';
+affected rows: 4
+info: Records: 3  Duplicates: 1  Warnings: 0
+#
+# 5 rows, consecutive auto_inc values
+#
+SELECT * FROM t1 order by k;
+id	k	c
+4	1	NULL
+1	2	1
+5	3	NULL
+2	4	NULL
+3	5	NULL
+affected rows: 5
+DROP TABLE t1;
+affected rows: 0
+CREATE TABLE t1(
+id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+k INT,
+c CHAR(1),
+UNIQUE KEY(k)) ENGINE=InnoDB;
+affected rows: 0
+#
+# Parallel execution
+#
+connect con1, localhost, root;
+connect con2, localhost, root;
+connection con1;
+#
+# Connection 1
+#
+SET DEBUG_SYNC=IF(@@innodb_autoinc_lock_mode > 0, 'ha_write_row_end WAIT_FOR continue', 'RESET');
+affected rows: 0
+INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1';
+connection con2;
+#
+# Connection 2
+#
+SET DEBUG_SYNC=IF(@@innodb_autoinc_lock_mode > 0, 'execute_command_after_close_tables SIGNAL continue', 'RESET');
+affected rows: 0
+INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
+ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection con1;
+#
+# 2 duplicates
+#
+affected rows: 3
+info: Records: 3  Duplicates: 0  Warnings: 0
+connection default;
+#
+# 3 rows
+#
+SELECT * FROM t1 order by k;
+id	k	c
+1	1	NULL
+2	2	NULL
+3	3	NULL
+affected rows: 3
+INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
+affected rows: 4
+info: Records: 3  Duplicates: 1  Warnings: 0
+SELECT * FROM t1 order by k;
+id	k	c
+1	1	NULL
+2	2	2
+3	3	NULL
+7	4	NULL
+8	5	NULL
+affected rows: 5
+disconnect con1;
+disconnect con2;
+connection default;
+DROP TABLE t1;
+#
+# Parallel test with read_committed
+#
+set global transaction isolation level read committed;
+drop table if exists t1;
 CREATE TABLE t1(
 id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
 k INT,
@@ -7,10 +140,16 @@ UNIQUE KEY(k)) ENGINE=InnoDB;
 connect con1, localhost, root;
 connect con2, localhost, root;
 connection con1;
+#
+# Connection 1
+#
 SET DEBUG_SYNC='ha_write_row_end SIGNAL continue2 WAIT_FOR continue1';
 affected rows: 0
 INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1';
 connection con2;
+#
+# Connection 2
+#
 SET DEBUG_SYNC='ha_write_row_start WAIT_FOR continue2';
 affected rows: 0
 SET DEBUG_SYNC='after_mysql_insert SIGNAL continue1';
@@ -22,6 +161,9 @@ connection con1;
 affected rows: 4
 info: Records: 3  Duplicates: 1  Warnings: 0
 SET DEBUG_SYNC='RESET';
+#
+# 5 rows, gap in autoinc values
+#
 SELECT * FROM t1 ORDER BY k;
 id	k	c
 1	1	NULL
@@ -33,3 +175,4 @@ disconnect con1;
 disconnect con2;
 connection default;
 DROP TABLE t1;
+set global transaction isolation level repeatable read;
diff --git a/mysql-test/suite/innodb/t/auto_increment_dup.opt b/mysql-test/suite/innodb/t/auto_increment_dup.opt
index 8235b0a..ab372c3 100644
--- a/mysql-test/suite/innodb/t/auto_increment_dup.opt
+++ b/mysql-test/suite/innodb/t/auto_increment_dup.opt
@@ -1 +1,2 @@
 --innodb_autoinc_lock_mode=1
+--innodb_lock_wait_timeout=2
diff --git a/mysql-test/suite/innodb/t/auto_increment_dup.test b/mysql-test/suite/innodb/t/auto_increment_dup.test
index 798a4ec..558fed2 100644
--- a/mysql-test/suite/innodb/t/auto_increment_dup.test
+++ b/mysql-test/suite/innodb/t/auto_increment_dup.test
@@ -10,23 +10,146 @@
 drop table if exists t1;
 --enable_warnings
 
+set global transaction isolation level repeatable read;
+
 CREATE TABLE t1(
        id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
        k INT,
        c CHAR(1),
        UNIQUE KEY(k)) ENGINE=InnoDB;
 
+SHOW CREATE TABLE t1;
+
 --enable_info
 
+--echo #
+--echo # Sequential execution
+--echo #
+
+INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1';
+
+--echo #
+--echo # 1 duplicate
+--echo #
+INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
+--echo #
+--echo # 5 rows, consecutive auto_inc values
+--echo #
+
+SELECT * FROM t1 order by k;
+
+DROP TABLE t1;
+
+CREATE TABLE t1(
+       id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+       k INT,
+       c CHAR(1),
+       UNIQUE KEY(k)) ENGINE=InnoDB;
+
+--echo #
+--echo # Sequential execution 2
+--echo #
+
+INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
+
+--echo #
+--echo # 1 duplicate
+--echo #
+INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1';
+--echo #
+--echo # 5 rows, consecutive auto_inc values
+--echo #
+
+SELECT * FROM t1 order by k;
+
+DROP TABLE t1;
+
+CREATE TABLE t1(
+       id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+       k INT,
+       c CHAR(1),
+       UNIQUE KEY(k)) ENGINE=InnoDB;
+       
+--echo #
+--echo # Parallel execution
+--echo #
+
 --connect(con1, localhost, root)
 --connect(con2, localhost, root)
 
 --connection con1
+--echo #
+--echo # Connection 1
+--echo #
+SET DEBUG_SYNC=IF(@@innodb_autoinc_lock_mode > 0, 'ha_write_row_end WAIT_FOR continue', 'RESET');
+--send INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1'
+--connection con2
+--echo #
+--echo # Connection 2
+--echo #
+SET DEBUG_SYNC=IF(@@innodb_autoinc_lock_mode > 0, 'execute_command_after_close_tables SIGNAL continue', 'RESET');
+--error 1205
+INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
+
+--connection con1
+--echo #
+--echo # 2 duplicates
+--echo #
+--reap
+--connection default
+--echo #
+--echo # 3 rows
+--echo #
+
+SELECT * FROM t1 order by k;
 
+INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
+
+SELECT * FROM t1 order by k;
+
+
+--disable_info
+
+--disconnect con1
+--disconnect con2
+
+--connection default
+
+DROP TABLE t1;
+
+--echo #
+--echo # Parallel test with read_committed
+--echo #
+
+set global transaction isolation level read committed;
+
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+CREATE TABLE t1(
+       id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
+       k INT,
+       c CHAR(1),
+       UNIQUE KEY(k)) ENGINE=InnoDB;
+
+--enable_info
+
+--connect(con1, localhost, root)
+--connect(con2, localhost, root)
+
+--connection con1
+
+--echo #
+--echo # Connection 1
+--echo #
 SET DEBUG_SYNC='ha_write_row_end SIGNAL continue2 WAIT_FOR continue1';
 --send INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1'
 
 --connection con2
+--echo #
+--echo # Connection 2
+--echo #
 SET DEBUG_SYNC='ha_write_row_start WAIT_FOR continue2';
 SET DEBUG_SYNC='after_mysql_insert SIGNAL continue1';
 INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
@@ -35,6 +158,10 @@ INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
 --reap
 --disable_info
 SET DEBUG_SYNC='RESET';
+
+--echo #
+--echo # 5 rows, gap in autoinc values
+--echo #
 SELECT * FROM t1 ORDER BY k;
 
 --disconnect con1
@@ -43,3 +170,6 @@ SELECT * FROM t1 ORDER BY k;
 --connection default
 
 DROP TABLE t1;
+
+set global transaction isolation level repeatable read;
+


More information about the commits mailing list