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

Merge 10.4 into 10.5

This commit is contained in:
Marko Mäkelä
2020-09-04 18:44:44 +03:00
94 changed files with 2110 additions and 1256 deletions

View File

@ -1945,6 +1945,95 @@ KILL ( SELECT 1 ) + LASTVAL(s);
ERROR 42000: KILL does not support subqueries or stored functions
KILL LASTVAL(s);
ERROR 42000: KILL does not support subqueries or stored functions
#
# MDEV-23094: Multiple calls to a Stored Procedure from another
# Stored Procedure crashes server
#
create table t1 (id1 int primary key, data1 int);
create table t2 (id2 int primary key, data2 int);
create procedure p1(IN id int, IN dt int)
begin
if (exists(select * from t1 where id1 = id and data1 = dt) or
not exists (select * from t2 where id2 = id and data2 = dt))
then
select 1;
end if;
end //
call p1(1,2);
1
1
call p1(1,2);
1
1
drop procedure p1;
create procedure p1(IN id int, IN dt int)
begin
case (exists(select * from t1 where id1 = id and data1 = dt) or
not exists (select * from t2 where id2 = id and data2 = dt))
when 1 then
select 1;
else
select 0;
end case;
end //
call p1(1,2);
1
1
call p1(1,2);
1
1
drop procedure p1;
create procedure p1(IN id int, IN dt int)
begin
declare wcont int default 1;
while (exists(select * from t1 where id1 = id and data1 = dt) or
not exists (select * from t2 where id2 = id and data2 = dt)) and wcont
do
select 1;
set wcont=0;
end while;
end //
call p1(1,2);
1
1
call p1(1,2);
1
1
drop procedure p1;
create procedure p1(IN id int, IN dt int)
begin
declare count int default 1;
repeat
select 1;
set count=count+1;
until (exists(select * from t1 where id1 = id and data1 = dt) or
not exists (select * from t2 where id2 = id and data2 = dt)) and
count < 3
end repeat;
end //
call p1(1,2);
1
1
call p1(1,2);
1
1
drop procedure p1;
create procedure p1(IN id int, IN dt int)
begin
for i in 1..(exists(select * from t1 where id1 = id and data1 = dt) or
not exists (select * from t2 where id2 = id and data2 = dt))
do
select 1;
end for;
end //
call p1(1,2);
1
1
call p1(1,2);
1
1
drop procedure p1;
drop table t1,t2;
# End of 10.4 tests
#
# Start of 10.5 tests