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:
@ -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 ;|
|
||||
|
Reference in New Issue
Block a user