mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
MDEV-24919 Crash with subselect formed by table value constructor and
used in set function If a subselect is formed by a table value constructor (TVC) then the following transformation is applied at the prepare stage: VALUES (v1), ... (vn) => SELECT * FROM (VALUES (v1), ... (vn)) tvc_x. The transformation is performed by the function wrap_tvc() that resets THD::LEX::current select to the top level select of the result of the transformation. After the call of wrap_tvc() in the function Item_subselect::wrap_tvc_into_select() the field THD::LEX::current must be reset to the same select as before the call. It was not done. As a result if the subselect formed by a TVC was an argument of a set function then an assertion was hit in the function Item_sum::check_sum_func(). Approved by Oleksandr Byelkin <sanja@mariadb.com>
This commit is contained in:
@ -2881,4 +2881,10 @@ NULL
|
||||
deallocate prepare stmt;
|
||||
drop view v1;
|
||||
drop table t1,t2,t3;
|
||||
#
|
||||
# MDEV-24919: subselect formed by TVC and used in set function
|
||||
#
|
||||
select sum((values(1)));
|
||||
sum((values(1)))
|
||||
1
|
||||
End of 10.3 tests
|
||||
|
Reference in New Issue
Block a user