summaryrefslogtreecommitdiff
path: root/mysql-test/suite/parts/t/partition_debug_innodb.test
blob: 0d065d0e3f26d09f3dac2443346b082e4153287a (plain)
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
78
79
80
81
82
83
84
85
86
87
88
# Partitioning test that require debug features and InnoDB
# including crashing tests.

--source include/have_debug.inc
--source include/have_innodb.inc
--source include/have_partition.inc
# Don't test this under valgrind, memory leaks will occur
--source include/not_valgrind.inc
# Crash tests don't work with embedded
--source include/not_embedded.inc

--let $DATADIR= `SELECT @@datadir;`

# Waiting for wl#6723
if (0)
{
--echo #
--echo # Bug#12696518/Bug#11766879/60106:DIFF BETWEEN # OF INDEXES IN MYSQL
--echo # VS INNODB, PARTITONING, ON INDEX CREATE
--echo #
CREATE TABLE t1
(a INT PRIMARY KEY,
 b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY HASH (a) PARTITIONS 3;
INSERT INTO t1 VALUES (0, 'first row'), (1, 'second row'), (2, 'Third row');
INSERT INTO t1 VALUES (3, 'row id 3'), (4, '4 row'), (5, 'row5');
INSERT INTO t1 VALUES (6, 'X 6 row'), (7, 'Seventh row'), (8, 'Last row');

ALTER TABLE t1 ADD INDEX new_b_index (b);
ALTER TABLE t1 DROP INDEX new_b_index;

SET @saved_dbug=@@debug_dbug;
SET SESSION debug_dbug = "+d,ha_partition_fail_final_add_index";

--error ER_NO_PARTITION_FOR_GIVEN_VALUE
ALTER TABLE t1 ADD INDEX (b);
SHOW CREATE TABLE t1;
--sorted_result
SELECT * FROM t1;

FLUSH TABLES;
--error ER_NO_PARTITION_FOR_GIVEN_VALUE
CREATE INDEX new_index ON t1 (b);
SHOW CREATE TABLE t1;
--sorted_result
SELECT * FROM t1;

SET SESSION debug_dbug = @saved_dbug;
SHOW CREATE TABLE t1;
DROP TABLE t1;
}

# Checking with #innodb what this is...
call mtr.add_suppression("InnoDB: Warning: allocated tablespace .*, old maximum was");
# If there is a crash or failure between the ddl_log is written and the
# operation is completed, mysql will try to drop a not yet created partition
call mtr.add_suppression("InnoDB: Error: table .* does not exist in the InnoDB internal");
call mtr.add_suppression("InnoDB: Warning: MySQL is trying to drop table ");


let $engine= 'InnoDB';

--echo # Test crash and failure recovery in fast_alter_partition_table.
--source suite/parts/inc/partition_mgm_crash.inc

--echo #
--echo # WL#4445: EXCHANGE PARTITION WITH TABLE
--echo # Verify ddl_log and InnoDB in case of crashing.
# Investigating if this warning is OK when crash testing.
call mtr.add_suppression("InnoDB: Warning: allocated tablespace .*, old maximum was ");
#
call mtr.add_suppression("Attempting backtrace. You can use the following information to find out");
call mtr.add_suppression("table .* does not exist in the InnoDB internal");

let $create_statement= CREATE TABLE t1 (a INT, b VARCHAR(64))
ENGINE = InnoDB
PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (10),
 PARTITION p1 VALUES LESS THAN MAXVALUE);
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");

let $create_statement2= CREATE TABLE t2 (a INT, b VARCHAR(64)) ENGINE = InnoDB;
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");
let $crash_statement= ALTER TABLE t1 EXCHANGE PARTITION p0 WITH TABLE t2;
--source suite/parts/inc/partition_crash_exchange.inc
let $fail_statement= $crash_statement;
--source suite/parts/inc/partition_fail_exchange.inc