1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-31494 Server crashes in ha_partition::index_blocks / get_key_scans_params

MDEV-31445 Server crashes in ha_partition::index_blocks / cost_for_index_read

The crash happened in the case where partition pruning finds 0
partitions.
This commit is contained in:
Monty
2023-06-21 14:00:18 +03:00
parent f25a74c0b0
commit d3c81804ba
3 changed files with 76 additions and 1 deletions

View File

@ -3062,3 +3062,40 @@ set optimizer_switch=@tmp_os;
drop table t1,t2,t3;
--echo #
--echo # MDEV-31494 Server crashes in ha_partition::index_blocks /
--echo # get_key_scans_params
--echo #
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b INT, c INT, KEY(c)) PARTITION BY LIST (b) (PARTITION p0 VALUES IN (1,2), PARTITION p1 VALUES IN (3,4));
INSERT INTO t2 VALUES (1,1),(2,2);
explain SELECT * FROM t1 STRAIGHT_JOIN t2 WHERE t2.b = 5 AND t2.c = 10;
SELECT * FROM t1 STRAIGHT_JOIN t2 WHERE t2.b = 5 AND t2.c = 10;
DROP TABLE t1, t2;
--echo #
--echo # MDEV-31445 Server crashes in ha_partition::index_blocks /
--echo # cost_for_index_read
--echo #
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (b INT);
CREATE TABLE t3 (c INT, d INT, KEY(d)) PARTITION BY KEY (c) PARTITIONS 2;
CREATE TABLE t4 (e INT);
INSERT INTO t1 VALUES (1),(2);
INSERT INTO t2 VALUES (1),(2);
INSERT INTO t3 VALUES (1,1),(2,2);
INSERT INTO t4 VALUES (1),(2);
explain SELECT * FROM t1 LEFT JOIN (t2 JOIN t3 ON (0 IN (SELECT e FROM t4) AND t3.d = t2.b)) ON (t3.c < t2.b);
SELECT * FROM t1 LEFT JOIN (t2 JOIN t3 ON (0 IN (SELECT e FROM t4) AND t3.d = t2.b)) ON (t3.c < t2.b);
drop table t1,t2,t3,t4;
--echo # End of 11.0 tests