mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
SQL: outdated select_lex->where fix [#365 bug 5]
Affected tests (forced mode): main.index_merge_myisam After optimization versioning AND takes operands from WHERE AND leaving `select_lex->where` as empty dangling AND.
This commit is contained in:
@ -367,6 +367,12 @@ order by i;
|
|||||||
f
|
f
|
||||||
0
|
0
|
||||||
0
|
0
|
||||||
|
### Issue #365, bug 5 (dangling AND)
|
||||||
|
create or replace table t1 (a int);
|
||||||
|
create or replace table t2 (b int) with system versioning;
|
||||||
|
select * from t1
|
||||||
|
where exists (select 1 from t2 where t2.b = t1.a and t2.b = t1.a);
|
||||||
|
a
|
||||||
drop view v1;
|
drop view v1;
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
call innodb_verify_vtq(28);
|
call innodb_verify_vtq(28);
|
||||||
|
@ -188,6 +188,12 @@ select min(i) over (partition by b) as f
|
|||||||
from (select i + 0 as i, b from t1) as tt
|
from (select i + 0 as i, b from t1) as tt
|
||||||
order by i;
|
order by i;
|
||||||
|
|
||||||
|
--echo ### Issue #365, bug 5 (dangling AND)
|
||||||
|
create or replace table t1 (a int);
|
||||||
|
create or replace table t2 (b int) with system versioning;
|
||||||
|
select * from t1
|
||||||
|
where exists (select 1 from t2 where t2.b = t1.a and t2.b = t1.a);
|
||||||
|
|
||||||
drop view v1;
|
drop view v1;
|
||||||
drop table t1, t2;
|
drop table t1, t2;
|
||||||
|
|
||||||
|
@ -976,6 +976,8 @@ int vers_setup_select(THD *thd, TABLE_LIST *tables, COND **where_expr,
|
|||||||
*dst_cond= cond1;
|
*dst_cond= cond1;
|
||||||
else
|
else
|
||||||
thd->change_item_tree(dst_cond, cond1);
|
thd->change_item_tree(dst_cond, cond1);
|
||||||
|
|
||||||
|
slex->where= *dst_cond;
|
||||||
}
|
}
|
||||||
} // if (... table->table->versioned())
|
} // if (... table->table->versioned())
|
||||||
} // for (table= tables; ...)
|
} // for (table= tables; ...)
|
||||||
|
Reference in New Issue
Block a user