Debian Codegraph @

mysql-test/suite/parts/t/partition_debug_innodb.test

raw
1 # Partitioning test that require debug features and InnoDB
2 # including crashing tests.
3
4 --source include/have_debug.inc
5 --source include/have_innodb.inc
6 --source include/have_partition.inc
7 # Don't test this under valgrind, memory leaks will occur. Also SIGKILL may
8 # not get trough and the test will hang.
9 --source include/not_valgrind.inc
10 # Crash tests don't work with embedded
11 --source include/not_embedded.inc
12
13 --let $DATADIR= `SELECT @@datadir;`
14
15 # Waiting for wl#6723
16 if (0)
17 {
18 --echo #
19 --echo # Bug#12696518/Bug#11766879/60106:DIFF BETWEEN # OF INDEXES IN MYSQL
20 --echo # VS INNODB, PARTITONING, ON INDEX CREATE
21 --echo #
22 CREATE TABLE t1
23 (a INT PRIMARY KEY,
24 b VARCHAR(64))
25 ENGINE = InnoDB
26 PARTITION BY HASH (a) PARTITIONS 3;
27 INSERT INTO t1 VALUES (0, 'first row'), (1, 'second row'), (2, 'Third row');
28 INSERT INTO t1 VALUES (3, 'row id 3'), (4, '4 row'), (5, 'row5');
29 INSERT INTO t1 VALUES (6, 'X 6 row'), (7, 'Seventh row'), (8, 'Last row');
30
31 ALTER TABLE t1 ADD INDEX new_b_index (b);
32 ALTER TABLE t1 DROP INDEX new_b_index;
33
34 SET @saved_dbug=@@debug_dbug;
35 SET SESSION debug_dbug = "+d,ha_partition_fail_final_add_index";
36
37 --error ER_NO_PARTITION_FOR_GIVEN_VALUE
38 ALTER TABLE t1 ADD INDEX (b);
39 SHOW CREATE TABLE t1;
40 --sorted_result
41 SELECT * FROM t1;
42
43 FLUSH TABLES;
44 --error ER_NO_PARTITION_FOR_GIVEN_VALUE
45 CREATE INDEX new_index ON t1 (b);
46 SHOW CREATE TABLE t1;
47 --sorted_result
48 SELECT * FROM t1;
49
50 SET SESSION debug_dbug = @saved_dbug;
51 SHOW CREATE TABLE t1;
52 DROP TABLE t1;
53 }
54
55 # Checking with #innodb what this is...
56 call mtr.add_suppression("InnoDB: Warning: allocated tablespace .*, old maximum was");
57 # If there is a crash or failure between the ddl_log is written and the
58 # operation is completed, mysql will try to drop a not yet created partition
59 call mtr.add_suppression("InnoDB: Error: table .* does not exist in the InnoDB internal");
60 call mtr.add_suppression("InnoDB: Warning: MariaDB is trying to drop table ");
61 call mtr.add_suppression("table .* does not exist in the InnoDB internal");
62
63
64 let $engine= 'InnoDB';
65
66 --echo #
67 --echo # WL#4445: EXCHANGE PARTITION WITH TABLE
68 --echo # Verify ddl_log and InnoDB in case of crashing.
69 # Investigating if this warning is OK when crash testing.
70 call mtr.add_suppression("InnoDB: Warning: allocated tablespace .*, old maximum was ");
71 #
72 call mtr.add_suppression("Attempting backtrace. You can use the following information to find out");
73 call mtr.add_suppression("table .* does not exist in the InnoDB internal");
74
75 let $create_statement= CREATE TABLE t1 (a INT, b VARCHAR(64))
76 ENGINE = InnoDB
77 PARTITION BY RANGE (a)
78 (PARTITION p0 VALUES LESS THAN (10),
79 PARTITION p1 VALUES LESS THAN MAXVALUE);
80 let $insert_statement= INSERT INTO t1 VALUES (1, "Original from partition p0"), (2, "Original from partition p0"), (3, "Original from partition p0"), (4, "Original from partition p0"), (11, "Original from partition p1"), (12, "Original from partition p1"), (13, "Original from partition p1"), (14, "Original from partition p1"), (21, "Original from partition p1"), (22, "Original from partition p1"), (23, "Original from partition p1"), (24, "Original from partition p1");
81
82 let $create_statement2= CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
83 let $insert_statement2= INSERT INTO t2 VALUES (5, "Original from table t2"), (6, "Original from table t2"), (7, "Original from table t2"), (8, "Original from table t2");
84 let $crash_statement= ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
85 --source suite/parts/inc/partition_crash_exchange.inc
86 let $fail_statement= $crash_statement;
87 --source suite/parts/inc/partition_fail_exchange.inc