#
# Bug#13737949: CRASH IN HA_PARTITION::INDEX_INIT
# Bug#18694052: SERVER CRASH IN HA_PARTITION::INIT_RECORD_PRIORITY_QUEUE
#
CREATE TABLE t1 (a INT, b VARCHAR(64), KEY(b,a))
PARTITION BY HASH (a) PARTITIONS 3;
INSERT INTO t1 VALUES (1, "1"), (2, "2"), (3, "3"), (4, "Four"), (5, "Five"),
(6, "Six"), (7, "Seven"), (8, "Eight"), (9, "Nine");
SET SESSION debug="+d,partition_fail_index_init";
SELECT * FROM t1 WHERE b = "Seven";
ERROR HY000: Table has no partition for value 0
SET SESSION debug="-d,partition_fail_index_init";
SELECT * FROM t1 WHERE b = "Seven";
a	b
7	Seven
DROP TABLE t1;
#
# Bug #30355485	CRASH WHEN DOING ANY OPERATION ON SUB-PARTITIONED TABLE
#
CREATE TABLE t1 (a INT, b INT) ENGINE = INNODB
PARTITION BY RANGE(a) SUBPARTITION BY HASH(b)
( PARTITION p0 VALUES LESS THAN (10) (SUBPARTITION s0, SUBPARTITION s1));
# Shut down the server
# Removing test/t1#P#p0#SP#s0.ibd manually
# restart
SELECT * FROM t1;
ERROR 42S02: Table 'test.t1' doesn't exist
DROP TABLE t1;
