mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
Merge branch '10.2' into 10.3
This commit is contained in:
commit
41a163ac5c
354 changed files with 3955 additions and 1103 deletions
|
|
@ -2289,4 +2289,115 @@ select * from ((select a from t1 limit 2) order by a desc) dt;
|
|||
drop view v1;
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-24454 Second execution of SELECT containing set function
|
||||
--echo # MDEV-25086: whose only argument is an outer reference to a column
|
||||
--echo # of mergeable view/derived/table/CTE
|
||||
--echo #
|
||||
|
||||
create table t1 (a int);
|
||||
create table t2 (b int);
|
||||
insert into t1 values (3), (1), (3);
|
||||
insert into t2 values (70), (30), (70);
|
||||
create view v1 as select * from t2;
|
||||
|
||||
prepare stmt from "
|
||||
select (select sum(b) from t1 where a=1) as r from v1;
|
||||
";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
deallocate prepare stmt;
|
||||
|
||||
prepare stmt from "
|
||||
select (select sum(b) from t1 where a=1) as r from (select * from t2) dt;
|
||||
";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
deallocate prepare stmt;
|
||||
|
||||
prepare stmt from "
|
||||
with cte as (select * from t2)
|
||||
select (select sum(b) from t1 where a=1) as r from cte;
|
||||
";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
deallocate prepare stmt;
|
||||
|
||||
prepare stmt from "
|
||||
select (select sum(b) from t1 where a=1) as r
|
||||
from (select * from v1 where b > 50) dt;
|
||||
";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
deallocate prepare stmt;
|
||||
|
||||
prepare stmt from "
|
||||
select (select sum(b) from t1 where a=1) as r
|
||||
from (select * from (select * from t2) dt1 where b > 50) dt;
|
||||
";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
deallocate prepare stmt;
|
||||
|
||||
prepare stmt from "
|
||||
with cte as (select * from (select * from t2) dt1 where b > 50)
|
||||
select (select sum(b) from t1 where a=1) as r from cte;
|
||||
";
|
||||
execute stmt;
|
||||
execute stmt;
|
||||
deallocate prepare stmt;
|
||||
|
||||
--delimiter |
|
||||
create procedure sp1()
|
||||
begin
|
||||
select (select sum(b) from t1 where a=1) as r from v1;
|
||||
end |
|
||||
--delimiter ;
|
||||
call sp1();
|
||||
call sp1();
|
||||
drop procedure sp1;
|
||||
|
||||
--delimiter |
|
||||
create procedure sp1()
|
||||
begin
|
||||
select (select sum(b) from t1 where a=1) as r from (select * from t2) dt;
|
||||
end |
|
||||
--delimiter ;
|
||||
call sp1();
|
||||
call sp1();
|
||||
drop procedure sp1;
|
||||
|
||||
--delimiter |
|
||||
create procedure sp1()
|
||||
begin
|
||||
with cte as (select * from t2)
|
||||
select (select sum(b) from t1 where a=1) as r from cte;
|
||||
end |
|
||||
--delimiter ;
|
||||
call sp1();
|
||||
call sp1();
|
||||
drop procedure sp1;
|
||||
|
||||
drop view v1;
|
||||
drop table t1,t2;
|
||||
|
||||
CREATE TABLE t1(f0 INT);
|
||||
INSERT INTO t1 VALUES (3);
|
||||
CREATE VIEW v1 AS SELECT f0 AS f1 FROM t1;
|
||||
CREATE VIEW v2 AS
|
||||
SELECT
|
||||
(SELECT GROUP_CONCAT(v1.f1 SEPARATOR ', ') FROM v1 n) AS f2,
|
||||
GROUP_CONCAT('aa' SEPARATOR ', ') AS f3
|
||||
FROM v1;
|
||||
CREATE VIEW v3 AS SELECT * FROM v2;
|
||||
|
||||
CREATE PROCEDURE p1()
|
||||
SELECT * FROM v3;
|
||||
CALL p1();
|
||||
CALL p1();
|
||||
|
||||
DROP PROCEDURE p1;
|
||||
DROP VIEW v1,v2,v3;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # End of 10.2 tests
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue