List:Commits« Previous MessageNext Message »
From:Vinay Fisrekar Date:September 26 2012 7:46pm
Subject:bzr push into mysql-5.6-wl6494 branch (vinay.fisrekar:4332 to 4333)
View as plain text  
 4333 Vinay Fisrekar	2012-09-27
      Add test (non dependent on debug build) to handle redo log size mismatch 
      (took negative cases from innodb-log-file-size which only runs for debug build)

    added:
      mysql-test/suite/innodb/r/innodb-log-file-size-1.result
      mysql-test/suite/innodb/t/innodb-log-file-size-1.test
 4332 Marko Mäkelä	2012-09-26
      WL#6494: Test in read-only mode.

    modified:
      mysql-test/suite/innodb/t/innodb-log-file-size.test
=== added file 'mysql-test/suite/innodb/r/innodb-log-file-size-1.result'
--- a/mysql-test/suite/innodb/r/innodb-log-file-size-1.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/r/innodb-log-file-size-1.result	2012-09-26 19:37:03 +0000
@@ -0,0 +1,157 @@
+call mtr.add_suppression("InnoDB: Resizing redo log");
+call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files");
+call mtr.add_suppression("InnoDB: New log files created");
+call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles");
+SET GLOBAL innodb_file_per_table = 1;
+SELECT @@innodb_file_per_table;
+@@innodb_file_per_table
+1
+SET GLOBAL innodb_file_format = `Barracuda`;
+SELECT @@innodb_file_format;
+@@innodb_file_format
+Barracuda
+SELECT @@innodb_log_file_size;
+@@innodb_log_file_size
+5242880
+DROP DATABASE IF EXISTS db_wl6494;
+CREATE DATABASE db_wl6494;
+USE db_wl6494;
+CREATE TABLE t1(id INT PRIMARY KEY,bfield blob) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,repeat('a',2000)),(2,repeat('b',2000)),
+(3,repeat('c',2000));
+START TRANSACTION;
+INSERT INTO t1 VALUES (11,repeat('a',2000)),(12,repeat('b',2000)),
+(13,repeat('c',2000));
+SAVEPOINT A;
+INSERT INTO t1 VALUES (21,repeat('a',2000)),(22,repeat('b',2000)),
+(23,repeat('c',2000));
+SAVEPOINT B;
+SELECT id,LEFT(bfield,20) FROM t1;
+id	LEFT(bfield,20)
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+3	cccccccccccccccccccc
+11	aaaaaaaaaaaaaaaaaaaa
+12	bbbbbbbbbbbbbbbbbbbb
+13	cccccccccccccccccccc
+21	aaaaaaaaaaaaaaaaaaaa
+22	bbbbbbbbbbbbbbbbbbbb
+23	cccccccccccccccccccc
+ROLLBACK TO A;
+COMMIT;
+SELECT id,LEFT(bfield,20) FROM t1;
+id	LEFT(bfield,20)
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+3	cccccccccccccccccccc
+11	aaaaaaaaaaaaaaaaaaaa
+12	bbbbbbbbbbbbbbbbbbbb
+13	cccccccccccccccccccc
+USE db_wl6494;
+SELECT id,LEFT(bfield,20) FROM t1;
+id	LEFT(bfield,20)
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+3	cccccccccccccccccccc
+11	aaaaaaaaaaaaaaaaaaaa
+12	bbbbbbbbbbbbbbbbbbbb
+13	cccccccccccccccccccc
+INSERT INTO t1 VALUES (1,repeat('a',2000)),(2,repeat('b',2000)),
+(3,repeat('c',2000));
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+INSERT INTO t1 VALUES (21,repeat('a',2000)),(22,repeat('b',2000)),
+(23,repeat('c',2000));
+SELECT id,LEFT(bfield,20) FROM t1;
+id	LEFT(bfield,20)
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+3	cccccccccccccccccccc
+11	aaaaaaaaaaaaaaaaaaaa
+12	bbbbbbbbbbbbbbbbbbbb
+13	cccccccccccccccccccc
+21	aaaaaaaaaaaaaaaaaaaa
+22	bbbbbbbbbbbbbbbbbbbb
+23	cccccccccccccccccccc
+DROP TABLE t1;
+DROP DATABASE db_wl6494;
+DROP DATABASE IF EXISTS db_wl6494;
+CREATE DATABASE db_wl6494;
+USE db_wl6494;
+CREATE TABLE t1(id INT PRIMARY KEY,bfield blob) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,repeat('a',2000)),(2,repeat('b',2000)),
+(3,repeat('c',2000));
+START TRANSACTION;
+INSERT INTO t1 VALUES (11,repeat('a',2000)),(12,repeat('b',2000)),
+(13,repeat('c',2000));
+SAVEPOINT A;
+INSERT INTO t1 VALUES (21,repeat('a',2000)),(22,repeat('b',2000)),
+(23,repeat('c',2000));
+SAVEPOINT B;
+SELECT id,LEFT(bfield,20) FROM t1;
+id	LEFT(bfield,20)
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+3	cccccccccccccccccccc
+11	aaaaaaaaaaaaaaaaaaaa
+12	bbbbbbbbbbbbbbbbbbbb
+13	cccccccccccccccccccc
+21	aaaaaaaaaaaaaaaaaaaa
+22	bbbbbbbbbbbbbbbbbbbb
+23	cccccccccccccccccccc
+ROLLBACK TO A;
+COMMIT;
+SELECT id,LEFT(bfield,20) FROM t1;
+id	LEFT(bfield,20)
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+3	cccccccccccccccccccc
+11	aaaaaaaaaaaaaaaaaaaa
+12	bbbbbbbbbbbbbbbbbbbb
+13	cccccccccccccccccccc
+USE db_wl6494;
+SELECT id,LEFT(bfield,20) FROM t1;
+id	LEFT(bfield,20)
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+3	cccccccccccccccccccc
+11	aaaaaaaaaaaaaaaaaaaa
+12	bbbbbbbbbbbbbbbbbbbb
+13	cccccccccccccccccccc
+INSERT INTO t1 VALUES (1,repeat('a',2000)),(2,repeat('b',2000)),
+(3,repeat('c',2000));
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+INSERT INTO t1 VALUES (21,repeat('a',2000)),(22,repeat('b',2000)),
+(23,repeat('c',2000));
+SELECT id,LEFT(bfield,20) FROM t1;
+id	LEFT(bfield,20)
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+3	cccccccccccccccccccc
+11	aaaaaaaaaaaaaaaaaaaa
+12	bbbbbbbbbbbbbbbbbbbb
+13	cccccccccccccccccccc
+21	aaaaaaaaaaaaaaaaaaaa
+22	bbbbbbbbbbbbbbbbbbbb
+23	cccccccccccccccccccc
+"test misc 1"
+"test misc 2"
+"test misc 4"
+"test misc 5"
+"test misc 6"
+USE db_wl6494;
+SELECT id,LEFT(bfield,20) FROM t1;
+id	LEFT(bfield,20)
+1	aaaaaaaaaaaaaaaaaaaa
+2	bbbbbbbbbbbbbbbbbbbb
+3	cccccccccccccccccccc
+11	aaaaaaaaaaaaaaaaaaaa
+12	bbbbbbbbbbbbbbbbbbbb
+13	cccccccccccccccccccc
+21	aaaaaaaaaaaaaaaaaaaa
+22	bbbbbbbbbbbbbbbbbbbb
+23	cccccccccccccccccccc
+INSERT INTO t1 VALUES (1,repeat('a',2000)),(2,repeat('b',2000)),
+(3,repeat('c',2000));
+ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+DROP TABLE t1;
+DROP DATABASE db_wl6494;

=== added file 'mysql-test/suite/innodb/t/innodb-log-file-size-1.test'
--- a/mysql-test/suite/innodb/t/innodb-log-file-size-1.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/innodb/t/innodb-log-file-size-1.test	2012-09-26 19:37:03 +0000
@@ -0,0 +1,262 @@
+######## suite/innodb/t/innodb-wl6445-1                     ##########
+#                                                                    #
+# Testcase for worklog WL#6494: InnoDB should be able to work if     #
+# redo log file size mismatch
+# Test resizing the InnoDB redo log.
+#                                                                    #
+#                                                                    #
+# Creation:                                                          #
+# 2011-09-26 Implemented this test as part of WL#6494                #
+#                                                                    #
+######################################################################
+
+
+# Not supported in embedded
+--source include/not_embedded.inc
+
+-- source include/have_innodb.inc
+# Valgrind would complain about memory leaks when we crash on purpose.
+--source include/not_valgrind.inc
+
+# restart with innodb-fast-shutdown=2 to on stopping it , behave as crash
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server 
+--source include/wait_until_disconnected.inc
+# Do something while server is down
+--enable_reconnect
+# Write file to make mysql-test-run.pl start up the server again
+--exec echo "restart: --innodb-fast-shutdown=2 " > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--source include/wait_until_connected_again.inc
+
+
+call mtr.add_suppression("InnoDB: Resizing redo log");
+call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files");
+call mtr.add_suppression("InnoDB: New log files created");
+call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles");
+
+let MYSQLD_DATADIR =`SELECT @@datadir`;
+let $innodb_file_per_table = `SELECT @@innodb_file_per_table`;
+let $innodb_file_format = `SELECT @@innodb_file_format`;
+let $innodb_log_file_size = `SELECT @@innodb_log_file_size`;
+
+SET GLOBAL innodb_file_per_table = 1;
+SELECT @@innodb_file_per_table;
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SELECT @@innodb_file_format;
+
+SELECT @@innodb_log_file_size;
+
+
+# Testcase 1 - set log file size > existing size and innodb_log_files_in_group > old value
+--disable_warnings
+DROP DATABASE IF EXISTS db_wl6494;
+--enable_warnings
+CREATE DATABASE db_wl6494;
+USE db_wl6494;
+
+CREATE TABLE t1(id INT PRIMARY KEY,bfield blob) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,repeat('a',2000)),(2,repeat('b',2000)),
+(3,repeat('c',2000));
+START TRANSACTION;
+INSERT INTO t1 VALUES (11,repeat('a',2000)),(12,repeat('b',2000)),
+(13,repeat('c',2000));
+SAVEPOINT A;
+INSERT INTO t1 VALUES (21,repeat('a',2000)),(22,repeat('b',2000)),
+(23,repeat('c',2000));
+SAVEPOINT B;
+SELECT id,LEFT(bfield,20) FROM t1;
+ROLLBACK TO A;
+COMMIT;
+SELECT id,LEFT(bfield,20) FROM t1;
+
+# restart with different redo log size
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+# Do something while server is down
+--enable_reconnect
+# Write file to make mysql-test-run.pl start up the server again
+# set log size from 5M to 10M
+--exec echo "restart: --innodb-log-file-size=15M --innodb_log_files_in_group=5" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--source include/wait_until_connected_again.inc
+
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
+let SEARCH_PATTERN= InnoDB: Starting an apply batch of log records;
+--source include/search_pattern_in_file.inc
+
+USE db_wl6494;
+SELECT id,LEFT(bfield,20) FROM t1;
+--ERROR ER_DUP_ENTRY
+INSERT INTO t1 VALUES (1,repeat('a',2000)),(2,repeat('b',2000)),
+(3,repeat('c',2000));
+INSERT INTO t1 VALUES (21,repeat('a',2000)),(22,repeat('b',2000)),
+(23,repeat('c',2000));
+SELECT id,LEFT(bfield,20) FROM t1;
+
+# clenaup of test
+# restart with different redo log size
+DROP TABLE t1;
+DROP DATABASE db_wl6494;
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+# Do something while server is down
+--error 0,1
+--move_file $SEARCH_FILE $MYSQLTEST_VARDIR/log/mysqld.1.err.old1
+--enable_reconnect
+# Write file to make mysql-test-run.pl start up the server again
+# set log size from 5M to 10M
+--exec echo "restart: --innodb-fast-shutdown=2" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--source include/wait_until_connected_again.inc
+
+
+# Testcase 2 - set log file size < existing size and innodb_log_files_in_group < old value
+--disable_warnings
+DROP DATABASE IF EXISTS db_wl6494;
+--enable_warnings
+CREATE DATABASE db_wl6494;
+USE db_wl6494;
+
+CREATE TABLE t1(id INT PRIMARY KEY,bfield blob) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1,repeat('a',2000)),(2,repeat('b',2000)),
+(3,repeat('c',2000));
+START TRANSACTION;
+INSERT INTO t1 VALUES (11,repeat('a',2000)),(12,repeat('b',2000)),
+(13,repeat('c',2000));
+SAVEPOINT A;
+INSERT INTO t1 VALUES (21,repeat('a',2000)),(22,repeat('b',2000)),
+(23,repeat('c',2000));
+SAVEPOINT B;
+SELECT id,LEFT(bfield,20) FROM t1;
+ROLLBACK TO A;
+COMMIT;
+SELECT id,LEFT(bfield,20) FROM t1;
+
+# restart with different redo log size
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+# Do something while server is down
+--enable_reconnect
+# Write file to make mysql-test-run.pl start up the server again
+# set log size from 15M to 10M
+--exec echo "restart: --innodb-log-file-size=10M --innodb_log_files_in_group=2" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--source include/wait_until_connected_again.inc
+
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
+let SEARCH_PATTERN= InnoDB: Starting an apply batch of log records;
+--source include/search_pattern_in_file.inc
+
+USE db_wl6494;
+SELECT id,LEFT(bfield,20) FROM t1;
+--ERROR ER_DUP_ENTRY
+INSERT INTO t1 VALUES (1,repeat('a',2000)),(2,repeat('b',2000)),
+(3,repeat('c',2000));
+INSERT INTO t1 VALUES (21,repeat('a',2000)),(22,repeat('b',2000)),
+(23,repeat('c',2000));
+SELECT id,LEFT(bfield,20) FROM t1;
+
+# end of testcase 2. Do not drop table/database as it is used in foloowing case
+
+# testcase misc
+let MYSQLD_DATADIR= `select @@datadir`;
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
+let $args=--loose-console > $SEARCH_FILE 2>&1;
+
+# Stop the server
+let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
+--exec echo "wait" > $restart_file
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--echo "test misc 1"
+--error 1
+--exec $MYSQLD_CMD $args --innodb-log-group-home-dir=foo\;bar
+let SEARCH_PATTERN= syntax error in innodb_log_group_home_dir, or a wrong number of mirrored log groups;
+--source include/search_pattern_in_file.inc
+--remove_file $SEARCH_FILE
+
+--echo "test misc 2"
+--error 1
+--exec $MYSQLD_CMD $args --innodb-mirrored-log-groups=2
+--source include/search_pattern_in_file.inc
+--remove_file $SEARCH_FILE
+
+#--echo "test misc 3"
+#--error 1
+#--exec $MYSQLD_CMD $args --innodb-read-only
+#let SEARCH_PATTERN= InnoDB: Recovery skipped, --innodb-read-only set!;
+#--source include/search_pattern_in_file.inc
+#let SEARCH_PATTERN= InnoDB: Can.t initiate database recovery, running in read-only-mode;
+#--source include/search_pattern_in_file.inc
+#--remove_file $SEARCH_FILE
+
+
+--echo "test misc 4"
+# We should have perfectly synced files here.
+# Rename the log files, and trigger an error in recovery.
+##--move_file $MYSQLD_DATADIR/ib_logfile101 $MYSQLD_DATADIR/ib_logfile0
+#--move_file $MYSQLD_DATADIR/ib_logfile1 $MYSQLD_DATADIR/ib_logfile1_hidden
+#--error 1
+#--exec $MYSQLD_CMD $args
+#let SEARCH_PATTERN= InnoDB: Only one log file found;
+#--source include/search_pattern_in_file.inc
+#--remove_file $SEARCH_FILE
+##--move_file $MYSQLD_DATADIR/ib_logfile0 $MYSQLD_DATADIR/ib_logfile101
+#--move_file $MYSQLD_DATADIR/ib_logfile1_hidden $MYSQLD_DATADIR/ib_logfile1
+
+--echo "test misc 5"
+# make copy of ib_logfile0 before editing
+--move_file $MYSQLD_DATADIR/ib_logfile0 $MYSQLD_DATADIR/ib_logfile0_hidden
+perl;
+die unless open(FILE, ">$ENV{MYSQLD_DATADIR}/ib_logfile0");
+print FILE "garbage";
+close(FILE);
+EOF
+--error 1
+--exec $MYSQLD_CMD $args
+let SEARCH_PATTERN= InnoDB: .*ib_logfile0 size 7 is not a multiple of innodb_page_size;
+--source include/search_pattern_in_file.inc
+--remove_file $SEARCH_FILE
+--remove_file $MYSQLD_DATADIR/ib_logfile0
+--move_file $MYSQLD_DATADIR/ib_logfile0_hidden $MYSQLD_DATADIR/ib_logfile0
+
+
+--echo "test misc 6"
+--move_file $MYSQLD_DATADIR/ib_logfile1 $MYSQLD_DATADIR/ib_logfile1_hidden
+perl;
+die unless open(FILE, ">$ENV{MYSQLD_DATADIR}/ib_logfile1");
+print FILE "garbage\n" x 131072;
+close(FILE);
+EOF
+
+--error 1
+--exec $MYSQLD_CMD $args
+let SEARCH_PATTERN= InnoDB: .*ib_logfile1 is of different size;
+--source include/search_pattern_in_file.inc
+--remove_file $SEARCH_FILE
+--remove_file $MYSQLD_DATADIR/ib_logfile1
+#--move_file $MYSQLD_DATADIR/ib_logfile0 $MYSQLD_DATADIR/ib_logfile101
+--move_file $MYSQLD_DATADIR/ib_logfile1_hidden $MYSQLD_DATADIR/ib_logfile1
+
+# restart server 
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+--disable_reconnect
+USE db_wl6494;
+SELECT id,LEFT(bfield,20) FROM t1;
+--ERROR ER_DUP_ENTRY
+INSERT INTO t1 VALUES (1,repeat('a',2000)),(2,repeat('b',2000)),
+(3,repeat('c',2000));
+
+# cleanup and set original values 
+DROP TABLE t1;
+DROP DATABASE db_wl6494;
+--remove_file $MYSQLTEST_VARDIR/log/mysqld.1.err.old1
+--disable_query_log
+eval SET GLOBAL INNODB_FILE_FORMAT=$innodb_file_format;
+eval SET GLOBAL INNODB_FILE_PER_TABLE=$innodb_file_per_table;
+--enable_query_log
+

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.6-wl6494 branch (vinay.fisrekar:4332 to 4333) Vinay Fisrekar26 Sep