1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-30529: Assertion `rnd_records <= s->found_records' failed in best_access_path

best_access_path() has an assertion:

   DBUG_ASSERT(rnd_records <= s->found_records);

make it rounding-safe.
This commit is contained in:
Sergei Petrunia
2023-02-03 15:23:38 +02:00
committed by Monty
parent 5faf2ac01b
commit cc81ea1cc4
3 changed files with 41 additions and 1 deletions

View File

@ -250,6 +250,27 @@ SELECT * FROM t1 AS a NATURAL JOIN t1 AS b;
DROP TABLE t1,t2,t3;
--echo #
--echo # MDEV-30529: Assertion `rnd_records <= s->found_records' failed in best_access_path
--echo #
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
CREATE TABLE t2 (b VARCHAR(1), c INT, d VARCHAR(1), e VARCHAR(1), KEY(b), KEY(d), KEY(e)) ENGINE=MyISAM;
INSERT INTO t2 VALUES ('x',0,'-','-'),
('x',0,'-','-'),('x',5,'-','-'),('x',0,'-','-'),('x',0,'-','-'),
('x',0,'-','-'),('x',0,'w','-'),('x',0,'-','-'),('x',0,'-','-'),
('x',0,'-','-'),('x',0,'-','-'),('x',0,'-','u'),('x',0,'-','-'),
('x',0,'-','-'),('x',0,'-','t'),('x',0,'-','-'),('x',0,'-','-'),
('x',0,'-','-'),('x',0,'-','-'),('x',0,'-','-'),('x',0,'-','p'),
('x',0,'z','-'),('x',0,'-','-'),('x',0,'-','-'),('x',0,'-','v');
set @tmp_jcl=@@join_cache_level;
SET JOIN_CACHE_LEVEL= 3;
SELECT * FROM t1 JOIN t2 ON t1.a = t2.c WHERE t2.b IN ('o') OR t2.e >= 'f' OR t2.d > 'p';
set join_cache_level=@tmp_jcl;
drop table t1,t2;
--echo #
--echo # End of the test file
--echo #