summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2021-02-24 13:51:47 -0800
committerIgor Babaev <igor@askmonty.org>2021-02-24 13:51:47 -0800
commitbf6484e7bb4af3a3bc60289d86e4bde813f4e0c0 (patch)
treee2420aaa46cc779d809c8941fb4ef20f19e6f1f0 /mysys
parent13f0e1e1392b1e275d55a7d37b3dac946d908bb0 (diff)
downloadmariadb-git-bf6484e7bb4af3a3bc60289d86e4bde813f4e0c0.tar.gz
MDEV-24910 Crash with SELECT that uses table value constructor as a subselect
This bug caused crashes of the server when processing queries with table value constructors (TVC) that contained subqueries and were used itself as subselects. For such TVCs the following transformation is applied at the prepare stage: VALUES (v1), ... (vn) => SELECT * FROM (VALUES (v1), ... (vn)) tvc_x. This transformation allows to reduce the problem of evaluation of TVCs used as subselects to the problem of evaluation of regular subselects. The transformation is implemented in the wrap_tvc(). The code the function to mimic the behaviour of the parser when processing the result of the transformation. However this imitation was not free of some flaws. First the function called the method exclude() that completely destroyed the select tree structures below the transformed TVC. Second the function used the procedure mysql_new_select to create st_select_lex nodes for both wrapping select of the transformation and TVC. This also led to constructing of invalid select tree structures. The patch actually re-engineers the code of wrap_tvc(). Approved by Oleksandr Byelkin <sanja@mariadb.com>
Diffstat (limited to 'mysys')
0 files changed, 0 insertions, 0 deletions