mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +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:
@ -3244,6 +3244,17 @@ SELECT * FROM t1 JOIN t2 ON (t2.code = t1.b) WHERE t1.a NOT IN ('baz', 'qux') OR
|
||||
id a b code num
|
||||
DROP TABLE t1, t2;
|
||||
#
|
||||
# MDEV-23634: Select query hanged the server and leads to OOM ...
|
||||
# (The fix is to add the same handling for "col!=const" as MDEV-21958 did for NOT IN)
|
||||
#
|
||||
create table t1 (pk int primary key, a int);
|
||||
insert into t1 (pk) values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
|
||||
# must not use range:
|
||||
explain select * from t1 force index (primary) where pk != 1 and pk!=2 ;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 10 Using where
|
||||
drop table t1;
|
||||
#
|
||||
# MDEV-22251: get_key_scans_params: Conditional jump or move depends on uninitialised value
|
||||
#
|
||||
create table t1 (pk int, i int, v int, primary key (pk), key(v));
|
||||
|
Reference in New Issue
Block a user