summaryrefslogtreecommitdiff
path: root/mysql-test/suite/parts/t
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@oracle.com>2011-09-15 20:49:39 +0200
committerMattias Jonsson <mattias.jonsson@oracle.com>2011-09-15 20:49:39 +0200
commit7d1cccae44dbf21bc7d935552fd5ec0968752833 (patch)
tree2e0c5c3951ea9c5742508de17b2790c27bfbc4bc /mysql-test/suite/parts/t
parent1a2b1ba6aa972b622b41417171f51998d5753c7d (diff)
downloadmariadb-git-7d1cccae44dbf21bc7d935552fd5ec0968752833.tar.gz
Bug#12696518: MEMORY LEAKS IN HA_PARTITION (VALGRIND TESTS ON TRUNK)
(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.
Diffstat (limited to 'mysql-test/suite/parts/t')
-rw-r--r--mysql-test/suite/parts/t/partition_debug_innodb.test35
1 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/suite/parts/t/partition_debug_innodb.test b/mysql-test/suite/parts/t/partition_debug_innodb.test
index c5d8df33213..b546f6d73f8 100644
--- a/mysql-test/suite/parts/t/partition_debug_innodb.test
+++ b/mysql-test/suite/parts/t/partition_debug_innodb.test
@@ -12,6 +12,41 @@ DROP TABLE IF EXISTS t1;
--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