diff options
author | Igor Babaev <igor@askmonty.org> | 2018-04-21 17:20:20 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2018-04-21 17:20:33 -0700 |
commit | 6242036f2776f7e5ddcd176c14fb3c3b674350ae (patch) | |
tree | d6977f83b77bd291fc05ddf6eb389965c7ec54d4 /mysql-test/main/table_value_constr.result | |
parent | c39f8a80c9fe7f7c5e5af95374d7bf2486f97da7 (diff) | |
download | mariadb-git-6242036f2776f7e5ddcd176c14fb3c3b674350ae.tar.gz |
MDEV-15940 Crash when using CURSOR with VALUES()
The function st_select_lex_unit::get_column_types() should
take into account that a unit may contain only a table
value constructor and nothing more.
Diffstat (limited to 'mysql-test/main/table_value_constr.result')
-rw-r--r-- | mysql-test/main/table_value_constr.result | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/main/table_value_constr.result b/mysql-test/main/table_value_constr.result index 39caba331ef..5a904cbca4b 100644 --- a/mysql-test/main/table_value_constr.result +++ b/mysql-test/main/table_value_constr.result @@ -2071,3 +2071,24 @@ ERROR HY000: Field reference 'b' can't be used in table value constructor select * from (values (1), (t1.b), (2)) as new_tvc; ERROR HY000: Field reference 't1.b' can't be used in table value constructor drop table t1; +# +# MDEV-MDEV-15940: cursor over TVC +# +BEGIN NOT ATOMIC +DECLARE v INT; +DECLARE cur CURSOR FOR VALUES(7); +OPEN cur; +FETCH cur INTO v; +SELECT v; +END; +| +v +7 +BEGIN NOT ATOMIC +DECLARE v INT DEFAULT 0; +FOR a IN (VALUES (7)) DO SET v = v + 1; END FOR; +SELECT v; +END; +| +v +1 |