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

MDEV-23634: Select query hanged the server and leads to OOM ...

Handle "col<>const" in the same way that MDEV-21958 did for
"col NOT IN(const-list)": do not use the condition for range/index_merge
accesses if there is a unique UNIQUE KEY(col).

The testcase is in main/range.test. The rest of test updates are
due to widespread use of 'pk<>1' in the testsuite. Changed the test
to use different but equivalent forms of the conditions.
This commit is contained in:
Sergei Petrunia
2021-04-08 17:25:02 +03:00
parent 4e2ca42225
commit c03841ec0e
21 changed files with 142 additions and 74 deletions

View File

@ -2215,6 +2215,17 @@ SELECT * FROM t1 JOIN t2 ON (t2.code = t1.b) WHERE t1.a NOT IN ('baz', 'qux') OR
DROP TABLE t1, t2;
--echo #
--echo # MDEV-23634: Select query hanged the server and leads to OOM ...
--echo # (The fix is to add the same handling for "col!=const" as MDEV-21958 did for NOT IN)
--echo #
create table t1 (pk int primary key, a int);
insert into t1 (pk) values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
--echo # must not use range:
explain select * from t1 force index (primary) where pk != 1 and pk!=2 ;
drop table t1;
--echo #
--echo # MDEV-22251: get_key_scans_params: Conditional jump or move depends on uninitialised value
--echo #