Details
-
Bug
-
Status: In Progress (View Workflow)
-
Major
-
Resolution: Unresolved
-
11.4
-
None
-
Q4/2026 Server Maintenance
Description
Start the server with the option --memory.optimizer_row_copy_cost=0
Then run the following scenario. Notice the optimizer_switch settings.
create table t1 (a int primary key); |
insert into t1 values (1),(2),(3); |
create table t2 (b int primary key); |
insert into t2 values (1),(2),(3),(4); |
create table t3 (c int, d int); |
insert into t3 values (1,1),(2,2),(3,3),(4,4),(5,5), |
(6,6),(7,7),(8,8),(9,9),(10,10);
|
insert into t3 select c+10, d+10 from t3; |
insert into t3 select c+20, d+20 from t3; |
insert into t3 select c+40, d+40 from t3; |
|
|
set optimizer_switch='firstmatch=off,loosescan=off'; |
set optimizer_where_cost=0; |
|
|
select t1.a x, t2.b y |
from |
t1 left join t2 on t1.a=t2.b |
where |
t1.a=1 and t2.b=1 and |
t1.a in (select c from t3) and rand() < 0; |
The SELECT generates the following result, which is incorrect, and instead should generate the empty set.
+---+---+ |
| x | y |
|
+---+---+ |
| 1 | 1 |
|
+---+---+ |
1 row in set (0.002 sec) |
Attachments
Issue Links
- is blocked by
-
MDEV-41303 rand() in a semi-join subquery is checked on outer rows
-
- In Progress
-
- relates to
-
MDEV-40731 Wrong result: WHERE condition containing a non-deterministic function is dropped when every non-const top-level JOIN_TAB is a SJM
-
- Closed
-