mysql-test/suite/innodb/t/log_first_rec_group.test | 33 +++++++++++++++++++--- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/mysql-test/suite/innodb/t/log_first_rec_group.test b/mysql-test/suite/innodb/t/log_first_rec_group.test index 48e68e8dfaa1..10a842693d9e 100644 --- a/mysql-test/suite/innodb/t/log_first_rec_group.test +++ b/mysql-test/suite/innodb/t/log_first_rec_group.test @@ -27,6 +27,7 @@ while ($pass != 2) { --echo # Initialization - create table, resets autoincrement value. CREATE TABLE t (a INT NOT NULL, b INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE = InnoDB; + CREATE TABLE undo_prealloc (a INT PRIMARY KEY) ENGINE = InnoDB; INSERT INTO t (a) VALUES (100); # Enable all METRICS within log module @@ -34,15 +35,27 @@ while ($pass != 2) { --source ../include/log_disable_page_cleaners.inc + # Allocate insert undo before positioning the log. Keep it active because + # creating a fresh insert undo log can generate more redo than fits in the + # single log block required by this scenario. + SET AUTOCOMMIT = 0; + INSERT INTO undo_prealloc VALUES (1); + + connect (log_block_filler,localhost,root,,); + connection log_block_filler; + --echo # 0. Move to the next log block. let $log_fill_block_sql = INSERT INTO t(a) VALUES (101); let $log_fill_block_and_crash = 0; --source ../include/log_fill_block.inc + + connection default; + disconnect log_block_filler; + let $start_lsn = $end_lsn; --echo # 1. Execute tiny mini-transaction in the current block [only pass 0] if ($pass == 0) { - SET AUTOCOMMIT = 0; INSERT INTO t (a) VALUES(102); if ($debug_test) { @@ -117,7 +130,7 @@ while ($pass != 2) { --echo LSN: $end_lsn } - DROP TABLE t; + DROP TABLE t, undo_prealloc; inc $pass; } @@ -139,6 +152,7 @@ while ($pass != 4) { --echo # Initialization - create table, resets autoincrement value. CREATE TABLE t (a INT NOT NULL, b INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE = InnoDB; + CREATE TABLE undo_prealloc (a INT PRIMARY KEY) ENGINE = InnoDB; INSERT INTO t (a) VALUES (200); # Enable all METRICS within log module @@ -146,11 +160,23 @@ while ($pass != 4) { --source ../include/log_disable_page_cleaners.inc + # Allocate insert undo before positioning the log. Keep it active because + # creating a fresh insert undo log can generate more redo than fits in the + # single log block required by this scenario. + SET AUTOCOMMIT = 0; + INSERT INTO undo_prealloc VALUES (1); + + connect (log_block_filler,localhost,root,,); + connection log_block_filler; + --echo # 0. Move to the next log block let $log_fill_block_sql = INSERT INTO t(a) VALUES (201); let $log_fill_block_and_crash = 0; --source ../include/log_fill_block.inc + connection default; + disconnect log_block_filler; + --echo # 1. Execute tiny mini-transaction in the current block [pass 0, 2] let $insert_202 = 0; if ($pass == 0) { @@ -160,7 +186,6 @@ while ($pass != 4) { let $insert_202 = 1; } if ($insert_202 == 1) { - SET AUTOCOMMIT = 0; INSERT INTO t (a) VALUES (202); } @@ -201,7 +226,7 @@ while ($pass != 4) { --disable_query_log --disable_result_log - DROP TABLE t; + DROP TABLE t, undo_prealloc; inc $pass; }