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

MDEV-29895 prepared view crash server (unit.conc_view)

it's incorrect to use change_item_tree() to replace arguments
of top-level AND/OR, because they (arguments) are stored in a List,
so a pointer to an argument is in the list_node, and individual
list_node's of top-level AND/OR can be deleted in Item_cond::build_equal_items().
In that case rollback_item_tree_changes() will modify the deleted object.

Luckily, it's not needed to use change_item_tree() for top-level
AND/OR, because the whole top-level item is copied and preserved
in prep_where and prep_on, and restored from there.

So, just don't.
This commit is contained in:
Sergei Golubchik
2022-10-28 16:08:43 +02:00
committed by Oleksandr Byelkin
parent 2f421688c6
commit 09c4253619
6 changed files with 69 additions and 9 deletions

View File

@ -1,4 +1,3 @@
drop table if exists t1, t2;
select 1 in (1,2,3);
1 in (1,2,3)
1
@ -942,6 +941,9 @@ SELECT ('0x',1) IN ((0,1),(1,1));
Warnings:
Warning 1292 Truncated incorrect DECIMAL value: '0x'
#
# End of 10.4 tests
#
#
# MDEV-29662 same values in `IN` set vs equal comparison produces
# the different performance
#
@ -1153,5 +1155,16 @@ DROP TABLE t1, t2, t3, t4;
DROP VIEW v1;
DROP PROCEDURE p1;
#
# End of 10.4 tests
# MDEV-29895 prepared view crash server (unit.conc_view)
#
create table t1 (username varchar(12) not null, id int(11) not null);
create view v1 as select username from t1 where id = 0;
prepare stmt from "select username from v1 where username in (?, ?)";
execute stmt using "1", "1";
username
deallocate prepare stmt;
drop view v1;
drop table t1;
#
# End of 10.6 tests
#