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

MDEV-24346 valgrind error in main.precedence

Part II.

It's still possible to bypass Item_func_like::escape
initialization in Item_func_like::fix_fields().

This requires ESCAPE argument being a cacheable subquery
that uses tables and is inside a derived table which
is used in multi-update.

Instead of implementing a complex or expensive fix for
this particular ridiculously artificial case, let's simply disallow it.
This commit is contained in:
Sergei Golubchik
2020-12-15 00:16:21 +01:00
parent a587ded283
commit 59211ab7b9
3 changed files with 30 additions and 1 deletions

View File

@ -294,3 +294,11 @@ insert t1 values (1),(2);
select 1 from (select distinct * from t1) as x where f < (select 1 like 2 escape (3=1));
1
drop table t1;
create table t1(f1 int);
insert into t1 values(1);
update (select 1 like 2 escape (1 in (select 1 from t1))) x, t1 as d set d.f1 = 1;
ERROR HY000: Incorrect arguments to ESCAPE
select * from (select 1 like 2 escape (1 in (select 1 from t1))) x;
1 like 2 escape (1 in (select 1 from t1))
0
drop table t1;