File: check_table_debug.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (77 lines) | stat: -rw-r--r-- 2,971 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
##########################################################################
# Test script to test CHECK TABLE
##########################################################################

--source include/not_valgrind.inc
--source include/have_debug.inc

--echo #########
--echo # SETUP #
--echo #########

--disable_query_log
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'.");
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'.");
call mtr.add_suppression("Apparent corruption in space .* page .* index `GEN_CLUST_INDEX`");
call mtr.add_suppression("In page .* of index `GEN_CLUST_INDEX` of table");
--enable_query_log

--let SEARCH_FILE = $MYSQLTEST_VARDIR/log/mysqld.1.err

CREATE TABLE t1(c1 CHAR(10), c2 CHAR(10));

--disable_query_log
SET @old_innodb_limit_optimistic_insert_debug = @@innodb_limit_optimistic_insert_debug;
--enable_query_log

SET GLOBAL innodb_limit_optimistic_insert_debug=2;

insert into t1 values ("r1c1", "r1c2");
insert into t1 values ("r2c1", "r2c2");
insert into t1 values ("r3c1", "r3c2");
insert into t1 values ("r4c1", "r4c2");
insert into t1 values ("r5c1", "r5c2");
insert into t1 values ("r6c1", "r6c2");

#-------------------------------------------------------------------------------
# Scenario 1 : Min bit is set wrongly to a record which is not the first record
#              on first page on level.
#-------------------------------------------------------------------------------

SET SESSION debug="+d,check_table_set_wrong_min_bit";
CHECK TABLE t1;

--echo # Expect found
--let SEARCH_PATTERN= Setting wrong min bit to 2nd record
--source include/search_pattern.inc

--echo # Expect found
--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'.
--source include/search_pattern.inc
SET SESSION debug="-d,check_table_set_wrong_min_bit";

#-------------------------------------------------------------------------------
# Scenario 2 : Min bit is not set to a record which is the first record on first
#              page on level.
#-------------------------------------------------------------------------------
SET SESSION debug="+d,check_table_reset_correct_min_bit";
CHECK TABLE t1;

--echo # Expect found
--let SEARCH_PATTERN= Resetting correct min bit to 1st record
--source include/search_pattern.inc

--echo # Expect found
--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'.
--source include/search_pattern.inc
SET SESSION debug="-d,check_table_reset_correct_min_bit";

--echo ###########
--echo # CLEANUP #
--echo ###########

--disable_query_log
SET GLOBAL innodb_limit_optimistic_insert_debug = @old_innodb_limit_optimistic_insert_debug;
--enable_query_log

drop table t1;