mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fixed mdev-15162 Query with CTE hangs if assignment operator (:=) is used
If setting user variable was used in the specification of a recursive CTE then Item_func_set_user_var::fix_fields() went into an infinite loop.
This commit is contained in:
@ -2085,3 +2085,15 @@ eval explain extended $q;
|
||||
set standard_compliant_cte=default;
|
||||
|
||||
drop table flights;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-15162: Setting user variable in recursive CTE
|
||||
--echo #
|
||||
|
||||
SET @c=1;
|
||||
|
||||
WITH RECURSIVE cte AS
|
||||
(SELECT 5
|
||||
UNION
|
||||
SELECT @c:=@c+1 FROM cte WHERE @c<3)
|
||||
SELECT * FROM cte;
|
||||
|
Reference in New Issue
Block a user