1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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.
This commit is contained in:
Igor Babaev
2018-04-21 17:20:20 -07:00
parent c39f8a80c9
commit 6242036f27
3 changed files with 46 additions and 1 deletions

View File

@ -1044,3 +1044,27 @@ select * from (values (1), (b), (2)) as new_tvc;
select * from (values (1), (t1.b), (2)) as new_tvc;
drop table t1;
--echo #
--echo # MDEV-MDEV-15940: cursor over TVC
--echo #
DELIMITER |;
BEGIN NOT ATOMIC
DECLARE v INT;
DECLARE cur CURSOR FOR VALUES(7);
OPEN cur;
FETCH cur INTO v;
SELECT v;
END;
|
BEGIN NOT ATOMIC
DECLARE v INT DEFAULT 0;
FOR a IN (VALUES (7)) DO SET v = v + 1; END FOR;
SELECT v;
END;
|
DELIMITER ;|