List:Commits« Previous MessageNext Message »
From:marko.makela Date:September 26 2012 10:10am
Subject:bzr push into mysql-5.6-wl6494 branch (marko.makela:4327 to 4331) WL#6494
View as plain text  
 4331 Marko Mäkelä	2012-09-26
      WL#6494: Cover some error handling.

    modified:
      mysql-test/suite/innodb/t/innodb-log-file-size.test
      storage/innobase/srv/srv0start.cc
 4330 Marko Mäkelä	2012-09-26
      WL#6494 error handling.
      
      Issue an error message when only ib_logfile0 is found.

    modified:
      mysql-test/suite/innodb/t/innodb-log-file-size.test
      storage/innobase/srv/srv0start.cc
 4329 Marko Mäkelä	2012-09-26
      WL#6494: Improve code coverage in the test.
      
      Ensure that InnoDB refuses to create log files in read-only mode.

    modified:
      mysql-test/suite/innodb/t/innodb-log-file-size.test
 4328 Marko Mäkelä	2012-09-26
      WL#6494: Improve code coverage in the test.

    modified:
      mysql-test/suite/innodb/t/innodb-log-file-size.test
 4327 Marko Mäkelä	2012-09-26
      WL#6494: Fix a regression from an incorrect goto-removal
      (marko.makela@strippedb5nrxez).

    modified:
      storage/innobase/srv/srv0start.cc
=== modified file 'mysql-test/suite/innodb/t/innodb-log-file-size.test'
--- a/mysql-test/suite/innodb/t/innodb-log-file-size.test	revid:marko.makela@stripped20926080927-w9w7igteb2olw4gq
+++ b/mysql-test/suite/innodb/t/innodb-log-file-size.test	revid:marko.makela@strippedom-20120926100947-yjzau2apt2lyyemp
@@ -45,9 +45,10 @@ SELECT * FROM t1;
 
 INSERT INTO t1 VALUES (123);
 
-let $MYSQLD_DATADIR= `select @@datadir`;
+let MYSQLD_DATADIR= `select @@datadir`;
 let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
-let crash=--loose-console > $SEARCH_FILE 2>&1 --innodb-force-recovery-crash;
+let $args=--loose-console > $SEARCH_FILE 2>&1;
+let crash=$args --innodb-force-recovery-crash;
 
 SET DEBUG='+d,crash_commit_before';
 # Write file to make mysql-test-run.pl restart the server
@@ -55,8 +56,17 @@ SET DEBUG='+d,crash_commit_before';
 --error 2013
 DELETE FROM t1;
 
---error 0,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
+
+--error 1
+--exec $MYSQLD_CMD $args --innodb-mirrored-log-groups=2
+--source include/search_pattern_in_file.inc
+--remove_file $SEARCH_FILE
+
 --echo --innodb-force-recovery-crash=1
 --error 137
 --exec $MYSQLD_CMD $crash=1
@@ -110,6 +120,13 @@ let SEARCH_PATTERN= InnoDB: Resizing red
 # this crashes right after deleting all log files
 --list_files $MYSQLD_DATADIR
 --remove_file $SEARCH_FILE
+
+--error 1
+--exec $MYSQLD_CMD $args --innodb-read-only
+let SEARCH_PATTERN= InnoDB: Cannot create log files in read-only mode;
+--source include/search_pattern_in_file.inc
+--remove_file $SEARCH_FILE
+
 --echo --innodb-force-recovery-crash=8
 --error 137
 --exec $MYSQLD_CMD $crash=8
@@ -124,6 +141,46 @@ let SEARCH_PATTERN= InnoDB: Setting log
 --source include/search_pattern_in_file.inc
 --list_files $MYSQLD_DATADIR
 --remove_file $SEARCH_FILE
+
+# 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
+
+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: Log file .*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_logfile101 $MYSQLD_DATADIR/ib_logfile0
+
+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: Log file .*ib_logfile1 is of different size 1048576 bytes than other log files 5242880 bytes!;
+--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
+
 --echo --innodb-force-recovery-crash=10
 --error 137
 --exec $MYSQLD_CMD $crash=10

=== modified file 'storage/innobase/srv/srv0start.cc'
--- a/storage/innobase/srv/srv0start.cc	revid:marko.makela@stripped9w7igteb2olw4gq
+++ b/storage/innobase/srv/srv0start.cc	revid:marko.makela@strippedemp
@@ -2057,6 +2057,8 @@ innobase_start_or_create_for_mysql(void)
 					goto files_checked;
 				} else if (i < 2) {
 					/* must have at least 2 log files */
+					ib_logf(IB_LOG_LEVEL_ERROR,
+						"Only one log file found.");
 					return(err);
 				}
 
@@ -2078,7 +2080,7 @@ innobase_start_or_create_for_mysql(void)
 
 			if (size & ((1 << UNIV_PAGE_SIZE_SHIFT) - 1)) {
 				ib_logf(IB_LOG_LEVEL_ERROR,
-					"InnoDB: Error: log file %s size "
+					"Log file %s size "
 					UINT64PF " is not a multiple of"
 					" innodb_page_size\n",
 					logfilename, size);
@@ -2093,7 +2095,7 @@ innobase_start_or_create_for_mysql(void)
 				ib_logf(IB_LOG_LEVEL_ERROR,
 					"Log file %s is"
 					" of different size "UINT64PF" bytes"
-					" than other log "
+					" than other log"
 					" files "UINT64PF" bytes!\n",
 					logfilename,
 					size << UNIV_PAGE_SIZE_SHIFT,

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.6-wl6494 branch (marko.makela:4327 to 4331) WL#6494marko.makela26 Sep