1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Merge 10.2 into 10.3

This commit is contained in:
Marko Mäkelä
2021-07-22 18:57:54 +03:00
41 changed files with 403 additions and 222 deletions

View File

@ -2590,8 +2590,8 @@ insert into t2 values (1,1),(2,2);
explain
with recursive cte as
( select * from t1 union select s1.* from t1 as s1, cte where s1.i1 = cte.i2 )
select * from t1 as t;
( select * from t2 union select s1.* from t2 as s1, cte where s1.i1 = cte.i2 )
select * from t2 as t;
drop table t1,t2;
@ -2875,6 +2875,50 @@ deallocate prepare stmt;
drop table t1,t2;
--echo #
--echo # MDEV-26189: Unknown column reference within hanging recursive CTE
--echo #
create table t1 (a int);
insert into t1 values (3), (7), (1);
let $q1=
with recursive
r as (select * from t1 union select s1.* from t1 as s1, r where s1.a = r.b)
select * from t1 as t;
--ERROR ER_BAD_FIELD_ERROR
eval $q1;
--ERROR ER_BAD_FIELD_ERROR
eval explain $q1;
eval create procedure sp1() $q1;
--ERROR ER_BAD_FIELD_ERROR
call sp1();
--ERROR ER_BAD_FIELD_ERROR
call sp1();
let $q2=
with recursive
r as (select * from t1 union select s1.* from t1 as s1, r where s1.b = r.a)
select * from t1 as t;
--ERROR ER_BAD_FIELD_ERROR
eval $q2;
--ERROR ER_BAD_FIELD_ERROR
eval explain $q2;
eval create procedure sp2() $q2;
--ERROR ER_BAD_FIELD_ERROR
call sp2();
--ERROR ER_BAD_FIELD_ERROR
call sp2();
drop procedure sp1;
drop procedure sp2;
drop table t1;
--echo #
--echo # End of 10.2 tests
--echo #