diff options
Diffstat (limited to 'mysql-test/suite/innodb/t/table_flags.test')
-rw-r--r-- | mysql-test/suite/innodb/t/table_flags.test | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/mysql-test/suite/innodb/t/table_flags.test b/mysql-test/suite/innodb/t/table_flags.test index 69f5d00693b..13e1fc01dc0 100644 --- a/mysql-test/suite/innodb/t/table_flags.test +++ b/mysql-test/suite/innodb/t/table_flags.test @@ -6,7 +6,7 @@ --disable_query_log call mtr.add_suppression("InnoDB: Table `mysql`\\.`innodb_table_stats` not found"); call mtr.add_suppression("InnoDB: incorrect flags in SYS_TABLES"); -call mtr.add_suppression("InnoDB: Table `test`.`t[czp]` in InnoDB data dictionary contains invalid flags\\. SYS_TABLES\\.TYPE=(129|289|3873|1232[31]) SYS_TABLES\\.N_COLS=2147483649\\r?$"); +call mtr.add_suppression("InnoDB: Table `test`.`t[cp]` in InnoDB data dictionary contains invalid flags\\. SYS_TABLES\\.TYPE=(129|289|3873|1232[31]) SYS_TABLES\\.N_COLS=2147483649\\r?$"); call mtr.add_suppression("InnoDB: Table `test`\\.`tr` in InnoDB data dictionary contains invalid flags\\. SYS_TABLES\\.TYPE=65 SYS_TABLES\\.MIX_LEN=4294967295\\r?$"); call mtr.add_suppression("InnoDB: Refusing to load '\\..test.td\\.ibd' \\(id=3, flags=0x([2e]1)\\); dictionary contains id=3, flags=0x100\\1\\r?$"); call mtr.add_suppression("InnoDB: Refusing to load '\\..test.td\\.ibd' \\(id=3, flags=0x(1[2ae]1)\\); dictionary contains id=3, flags=0x10\\1\\r?$"); @@ -15,7 +15,7 @@ call mtr.add_suppression("InnoDB: Ignoring tablespace for `test`.`td` because it call mtr.add_suppression("InnoDB: Operating system error number .* in a file operation"); call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified"); call mtr.add_suppression("InnoDB: If you are installing InnoDB, remember that you must create directories yourself"); -call mtr.add_suppression("InnoDB: adjusting FSP_SPACE_FLAGS of tablespace"); +call mtr.add_suppression("InnoDB: adjusting FSP_SPACE_FLAGS of file "); FLUSH TABLES; --enable_query_log @@ -29,10 +29,12 @@ let bugdir= $MYSQLTEST_VARDIR/tmp/table_flags; --let $d=--innodb-data-home-dir=$bugdir --innodb-log-group-home-dir=$bugdir --let $d=$d --innodb-data-file-path=ibdata1:1M:autoextend --let $d=$d --innodb-undo-tablespaces=0 +--let $d=$d --innodb-purge-rseg-truncate-frequency=1 +--let $d=$d --skip-innodb-fast-shutdown if ($have_debug) { --let $d=$d --debug=d,create_and_drop_garbage } ---let $restart_parameters=$d --innodb-stats-persistent=0 --innodb-file-format=1 +--let $restart_parameters=$d --innodb-stats-persistent=0 --source include/restart_mysqld.inc SET GLOBAL innodb_file_per_table=1; @@ -50,6 +52,7 @@ PAGE_COMPRESSED=1 PAGE_COMPRESSION_LEVEL=9; --source include/shutdown_mysqld.inc --perl use strict; +do "$ENV{MTR_SUITE_DIR}/include/crc32.pl"; my $ps= $ENV{INNODB_PAGE_SIZE}; my $file= "$ENV{bugdir}/ibdata1"; open(FILE, "+<", $file) || die "Unable to open $file\n"; @@ -125,8 +128,11 @@ for (my $offset= 0x65; $offset; } print ")\n"; } -substr($page,0,4)=pack("N",0xdeadbeef); -substr($page,$ps-8,4)=pack("N",0xdeadbeef); +my $polynomial = 0x82f63b78; # CRC-32C +my $ck= pack("N",mycrc32(substr($page, 4, 22), 0, $polynomial) ^ + mycrc32(substr($page, 38, $ps - 38 - 8), 0, $polynomial)); +substr($page,0,4)=$ck; +substr($page,$ps-8,4)=$ck; sysseek(FILE, $sys_tables_root*$ps, 0) || die "Unable to seek $file"; syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n"; close(FILE) || die "Unable to close $file\n"; @@ -141,15 +147,19 @@ SHOW CREATE TABLE tc; SELECT * FROM tc; SHOW CREATE TABLE td; SELECT * FROM td; ---error ER_NO_SUCH_TABLE_IN_ENGINE +# This table was converted to NO_ROLLBACK due to the SYS_TABLES.TYPE change. SHOW CREATE TABLE tz; +BEGIN; +INSERT INTO tz VALUES(42); +ROLLBACK; +SELECT * FROM tz; --error ER_NO_SUCH_TABLE_IN_ENGINE SHOW CREATE TABLE tp; --source include/shutdown_mysqld.inc let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err; ---let SEARCH_PATTERN= InnoDB: Table `test`.`t[czp]` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=(129|289|3873|1232[13]) SYS_TABLES\.N_COLS=2147483649 +--let SEARCH_PATTERN= InnoDB: Table `test`.`t[cp]` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=(129|289|3873|1232[13]) SYS_TABLES\.N_COLS=2147483649 --source include/search_pattern_in_file.inc --let SEARCH_PATTERN= InnoDB: Table `test`\.`tr` in InnoDB data dictionary contains invalid flags\. SYS_TABLES\.TYPE=65 SYS_TABLES\.MIX_LEN=4294967295\b --source include/search_pattern_in_file.inc @@ -184,14 +194,17 @@ BEGIN; INSERT INTO tr VALUES(1); INSERT INTO tc VALUES(1); INSERT INTO td VALUES(1); -INSERT INTO tz VALUES(1); +# We cannot access tz, because due to our fiddling of the NO_ROLLBACK flag, +# it now has a record with DB_TRX_ID=0, which is invalid for +# transactional tables until MDEV-12288 is implemented. +# INSERT INTO tz VALUES(1); INSERT INTO tp VALUES(1); ROLLBACK; SELECT * FROM tr; SELECT * FROM tc; SELECT * FROM td; -SELECT * FROM tz; +# SELECT * FROM tz; SELECT * FROM tp; DROP TABLE tr,tc,td,tz,tp; |