mirror of
https://github.com/MariaDB/server.git
synced 2025-07-05 12:42:17 +03:00
(also 5.5+ solution for bug#11766879/bug#60106) The valgrind warning was due to an unused 'new handler_add_index(...)' which was never freed. The error handling did not work (fails as in bug#11766879) and the implementation was not as transparant as it could, therefore I made it a bit simpler and more transparant to the underlying handlers. This way it follows the api better and the error handling works and is also now tested. Also added a debug test to verify the error handling. Improved according to Jon Olavs review: Added class ha_partition_add_index. Also added base class Sql_alloc to handler_add_index. Update 3.
62 lines
1.8 KiB
Plaintext
62 lines
1.8 KiB
Plaintext
# Partitioning test that require debug features
|
|
# including crashing tests.
|
|
|
|
--source include/have_debug.inc
|
|
--source include/have_innodb.inc
|
|
--source include/have_partition.inc
|
|
--source include/not_valgrind.inc
|
|
|
|
--disable_warnings
|
|
DROP TABLE IF EXISTS t1;
|
|
--enable_warnings
|
|
|
|
--let $DATADIR= `SELECT @@datadir;`
|
|
|
|
--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 SESSION debug= "+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= "-d,ha_partition_fail_final_add_index";
|
|
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
|