| 1 |
########################################################################## |
| 2 |
# Test script to test CHECK TABLE |
| 3 |
########################################################################## |
| 4 |
|
| 5 |
--source include/not_valgrind.inc |
| 6 |
--source include/have_debug.inc |
| 7 |
|
| 8 |
--echo ######### |
| 9 |
--echo # SETUP # |
| 10 |
--echo ######### |
| 11 |
|
| 12 |
--disable_query_log |
| 13 |
call mtr.add_suppression("Minimum record flag is wrongly set to rec on page .* at level .* for index 'GEN_CLUST_INDEX' of table 'test/t1'."); |
| 14 |
call mtr.add_suppression("Minimum record flag is not set to first rec on page .* at level .* for index 'GEN_CLUST_INDEX' of table 'test/t1'."); |
| 15 |
call mtr.add_suppression("Apparent corruption in space .* page .* index `GEN_CLUST_INDEX`"); |
| 16 |
call mtr.add_suppression("In page .* of index `GEN_CLUST_INDEX` of table"); |
| 17 |
--enable_query_log |
| 18 |
|
| 19 |
--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err |
| 20 |
|
| 21 |
CREATE TABLE t1(c1 CHAR(10), c2 CHAR(10)); |
| 22 |
|
| 23 |
--disable_query_log |
| 24 |
SET @old_innodb_limit_optimistic_insert_debug = @@innodb_limit_optimistic_insert_debug; |
| 25 |
--enable_query_log |
| 26 |
|
| 27 |
SET GLOBAL innodb_limit_optimistic_insert_debug=2; |
| 28 |
|
| 29 |
insert into t1 values ("r1c1", "r1c2"); |
| 30 |
insert into t1 values ("r2c1", "r2c2"); |
| 31 |
insert into t1 values ("r3c1", "r3c2"); |
| 32 |
insert into t1 values ("r4c1", "r4c2"); |
| 33 |
insert into t1 values ("r5c1", "r5c2"); |
| 34 |
insert into t1 values ("r6c1", "r6c2"); |
| 35 |
|
| 36 |
#------------------------------------------------------------------------------- |
| 37 |
# Scenario 1 : Min bit is set wrongly to a record which is not the first record |
| 38 |
# on first page on level. |
| 39 |
#------------------------------------------------------------------------------- |
| 40 |
|
| 41 |
SET SESSION debug="+d,check_table_set_wrong_min_bit"; |
| 42 |
CHECK TABLE t1; |
| 43 |
|
| 44 |
--echo # Expect found |
| 45 |
--let SEARCH_PATTERN= Setting wrong min bit to 2nd record |
| 46 |
--source include/search_pattern.inc |
| 47 |
|
| 48 |
--echo # Expect found |
| 49 |
--let SEARCH_PATTERN= Minimum record flag is wrongly set to rec on page '4' at level '3' for index 'GEN_CLUST_INDEX' of table 'test/t1'. |
| 50 |
--source include/search_pattern.inc |
| 51 |
SET SESSION debug="-d,check_table_set_wrong_min_bit"; |
| 52 |
|
| 53 |
#------------------------------------------------------------------------------- |
| 54 |
# Scenario 2 : Min bit is not set to a record which is the first record on first |
| 55 |
# page on level. |
| 56 |
#------------------------------------------------------------------------------- |
| 57 |
SET SESSION debug="+d,check_table_reset_correct_min_bit"; |
| 58 |
CHECK TABLE t1; |
| 59 |
|
| 60 |
--echo # Expect found |
| 61 |
--let SEARCH_PATTERN= Resetting correct min bit to 1st record |
| 62 |
--source include/search_pattern.inc |
| 63 |
|
| 64 |
--echo # Expect found |
| 65 |
--let SEARCH_PATTERN= Minimum record flag is not set to first rec on page '4' at level '3' for index 'GEN_CLUST_INDEX' of table 'test/t1'. |
| 66 |
--source include/search_pattern.inc |
| 67 |
SET SESSION debug="-d,check_table_reset_correct_min_bit"; |
| 68 |
|
| 69 |
--echo ########### |
| 70 |
--echo # CLEANUP # |
| 71 |
--echo ########### |
| 72 |
|
| 73 |
--disable_query_log |
| 74 |
SET GLOBAL innodb_limit_optimistic_insert_debug = @old_innodb_limit_optimistic_insert_debug; |
| 75 |
--enable_query_log |
| 76 |
|
| 77 |
drop table t1; |