SSL sp-code.result
Interaktion und PortierbarkeitLisp
drop procedure if exists empty;
drop procedure if exists code_sample;
create procedure empty()
begin
end;
show procedure code empty;
Pos Instruction
drop procedure empty;
create function almost_empty()
returns int return0;
show function code almost_empty;
Pos Instruction 0 freturn int 0
drop function almost_empty;
create procedure code_sample(x int, out err int, out nulls int)
begin
declare count int default 0; set nulls = 0;
begin
declare c cursor for select name from t1;
declare exit handler for not found close c;
open c; loop
begin
declare n varchar(20);
declare continue handler for sqlexception set err=1;
fetch c into n; if isnull(n) then set nulls = nulls + 1;
else set count = count + 1;
update t2 set idx = count where name=n;
end if;
end;
end loop;
end;
select t.name, t.idx from t2 t order by idx asc;
end//
show procedure code code_sample;
Pos Instruction 0set count@30 1set nulls@20 2 cpush c@0 3 hpush_jump 64 EXIT 4 cclose c@0 5 hreturn 019 6 copen c@0 7set n@4 NULL 8 hpush_jump 115 CONTINUE 9set err@11 10 hreturn 5 11 cfetch c@0 n@4 12 jump_if_not 15(17) n@4 is null 13set nulls@2 nulls@2 + 1 14 jump 17 15set count@3 count@3 + 1 16 stmt 4"update t2 set idx = count where name=n" 17 hpop 1 18 jump 7 19 hpop 1 20 cpop 1 21 stmt 0"select t.name, t.idx from t2 t order ..."
drop procedure code_sample;
drop procedure if exists sudoku_solve;
create procedure sudoku_solve(p_naive boolean, p_all boolean)
deterministic
modifies sql data
begin
drop temporary table if exists sudoku_work, sudoku_schedule;
create temporary table sudoku_work
(
row smallint not null,
col smallint not null,
dig smallint not null,
cnt smallint,
key using btree (cnt),
key using btree (row),
key using btree (col),
unique key using hash (row,col)
);
create temporary table sudoku_schedule
(
idx int not null auto_increment primary key,
row smallint not null,
col smallint not null
);
call sudoku_init(); if p_naive then
update sudoku_work set cnt = 0 where dig = 0;
else
call sudoku_count();
end if;
insert into sudoku_schedule (row,col)
select row,col from sudoku_work where cnt is not null order by cnt desc;
begin
declare v_scounter bigint default 0;
declare v_i smallint default 1;
declare v_dig smallint;
declare v_schedmax smallint;
select count(*) into v_schedmax from sudoku_schedule;
more: loop
begin
declare v_tcounter bigint default 0;
sched:
while v_i <= v_schedmax do
begin
declare v_row, v_col smallint;
select row,col into v_row,v_col from sudoku_schedule where v_i = idx;
select dig into v_dig from sudoku_work
where v_row = row and v_col = col; case v_dig
when 0 then set v_dig = 1;
update sudoku_work set dig = 1
where v_row = row and v_col = col;
when 9 then if v_i > 0 then
update sudoku_work set dig = 0
where v_row = row and v_col = col; set v_i = v_i - 1;
iterate sched;
else
select v_scounter as 'Solutions';
leave more;
end if;
else set v_dig = v_dig + 1;
update sudoku_work set dig = v_dig
where v_row = row and v_col = col;
end case; set v_tcounter = v_tcounter + 1; ifnot sudoku_digit_ok(v_row, v_col, v_dig) then
iterate sched;
end if; set v_i = v_i + 1;
end;
end while sched;
select dig from sudoku_work;
select v_tcounter as 'Tests'; set v_scounter = v_scounter + 1; if p_all and v_i > 0 then set v_i = v_i - 1;
else
leave more;
end if;
end;
end loop more;
end;
drop temporary table sudoku_work, sudoku_schedule;
end//
show procedure code sudoku_solve;
Pos Instruction 0 stmt 9"drop temporary table if exists sudoku..." 1 stmt 1"create temporary table sudoku_work ( ..." 2 stmt 1"create temporary table sudoku_schedul..." 3 stmt 88"call sudoku_init()" 4 jump_if_not 7(8) p_naive@0 5 stmt 4"update sudoku_work set cnt = 0 where ..." 6 jump 8 7 stmt 88"call sudoku_count()" 8 stmt 6"insert into sudoku_schedule (row,col)..." 9set v_scounter@20 10set v_i@31 11set v_dig@4 NULL 12set v_schedmax@5 NULL 13 stmt 0"select count(*) into v_schedmax from ..." 14set v_tcounter@60 15 jump_if_not 39(39) v_i@3 <= v_schedmax@5 16set v_row@7 NULL 17set v_col@8 NULL 18 stmt 0"select row,col into v_row,v_col from ..." 19 stmt 0"select dig into v_dig from sudoku_wor..." 20 set_case_expr (34) 0 v_dig@4 21 jump_if_not 25(34) case_expr@0 = 0 22set v_dig@41 23 stmt 4"update sudoku_work set dig = 1 where ..." 24 jump 34 25 jump_if_not 32(34) case_expr@0 = 9 26 jump_if_not 30(34) v_i@3 > 0 27 stmt 4"update sudoku_work set dig = 0 where ..." 28set v_i@3 v_i@3 - 1 29 jump 15 30 stmt 0"select v_scounter as 'Solutions'" 31 jump 45 32set v_dig@4 v_dig@4 + 1 33 stmt 4"update sudoku_work set dig = v_dig wh..." 34set v_tcounter@6 v_tcounter@6 + 1 35 jump_if_not 37(37) !`sudoku_digit_ok`(v_row@7,v_col@8,v_dig@4) 36 jump 15 37set v_i@3 v_i@3 + 1 38 jump 15 39 stmt 0"select dig from sudoku_work" 40 stmt 0"select v_tcounter as 'Tests'" 41set v_scounter@2 v_scounter@2 + 1 42 jump_if_not 45(14) p_all@1and v_i@3 > 0 43set v_i@3 v_i@3 - 1 44 jump 14 45 stmt 9"drop temporary table sudoku_work, sud..."
drop procedure sudoku_solve;
DROP PROCEDURE IF EXISTS proc_19194_simple;
DROP PROCEDURE IF EXISTS proc_19194_searched;
DROP PROCEDURE IF EXISTS proc_19194_nested_1;
DROP PROCEDURE IF EXISTS proc_19194_nested_2;
DROP PROCEDURE IF EXISTS proc_19194_nested_3;
DROP PROCEDURE IF EXISTS proc_19194_nested_4;
CREATE PROCEDURE proc_19194_simple(i int)
BEGIN
DECLARE str CHAR(10); CASE i
WHEN 1 THEN SET str="1";
WHEN 2 THEN SET str="2";
WHEN 3 THEN SET str="3";
ELSE SET str="unknown";
END CASE;
SELECT str;
END|
CREATE PROCEDURE proc_19194_searched(i int)
BEGIN
DECLARE str CHAR(10); CASE
WHEN i=1 THEN SET str="1";
WHEN i=2 THEN SET str="2";
WHEN i=3 THEN SET str="3";
ELSE SET str="unknown";
END CASE;
SELECT str;
END|
CREATE PROCEDURE proc_19194_nested_1(i int, j int)
BEGIN
DECLARE str_i CHAR(10);
DECLARE str_j CHAR(10); CASE i
WHEN 10 THEN SET str_i="10";
WHEN 20 THEN
BEGIN set str_i="20"; CASE
WHEN j=1 THEN SET str_j="1";
WHEN j=2 THEN SET str_j="2";
WHEN j=3 THEN SET str_j="3";
ELSE SET str_j="unknown";
END CASE;
select "i was 20";
END;
WHEN 30 THEN SET str_i="30";
WHEN 40 THEN SET str_i="40";
ELSE SET str_i="unknown";
END CASE;
SELECT str_i, str_j;
END|
CREATE PROCEDURE proc_19194_nested_2(i int, j int)
BEGIN
DECLARE str_i CHAR(10);
DECLARE str_j CHAR(10); CASE
WHEN i=10 THEN SET str_i="10";
WHEN i=20 THEN
BEGIN set str_i="20"; CASE j
WHEN 1 THEN SET str_j="1";
WHEN 2 THEN SET str_j="2";
WHEN 3 THEN SET str_j="3";
ELSE SET str_j="unknown";
END CASE;
select "i was 20";
END;
WHEN i=30 THEN SET str_i="30";
WHEN i=40 THEN SET str_i="40";
ELSE SET str_i="unknown";
END CASE;
SELECT str_i, str_j;
END|
CREATE PROCEDURE proc_19194_nested_3(i int, j int)
BEGIN
DECLARE str_i CHAR(10);
DECLARE str_j CHAR(10); CASE i
WHEN 10 THEN SET str_i="10";
WHEN 20 THEN
BEGIN set str_i="20"; CASE j
WHEN 1 THEN SET str_j="1";
WHEN 2 THEN SET str_j="2";
WHEN 3 THEN SET str_j="3";
ELSE SET str_j="unknown";
END CASE;
select "i was 20";
END;
WHEN 30 THEN SET str_i="30";
WHEN 40 THEN SET str_i="40";
ELSE SET str_i="unknown";
END CASE;
SELECT str_i, str_j;
END|
CREATE PROCEDURE proc_19194_nested_4(i int, j int)
BEGIN
DECLARE str_i CHAR(10);
DECLARE str_j CHAR(10); CASE
WHEN i=10 THEN SET str_i="10";
WHEN i=20 THEN
BEGIN set str_i="20"; CASE
WHEN j=1 THEN SET str_j="1";
WHEN j=2 THEN SET str_j="2";
WHEN j=3 THEN SET str_j="3";
ELSE SET str_j="unknown";
END CASE;
select "i was 20";
END;
WHEN i=30 THEN SET str_i="30";
WHEN i=40 THEN SET str_i="40";
ELSE SET str_i="unknown";
END CASE;
SELECT str_i, str_j;
END|
SHOW PROCEDURE CODE proc_19194_simple;
Pos Instruction 0set str@1 NULL 1 set_case_expr (12) 0 i@0 2 jump_if_not 5(12) case_expr@0 = 1 3set str@1'1' 4 jump 12 5 jump_if_not 8(12) case_expr@0 = 2 6set str@1'2' 7 jump 12 8 jump_if_not 11(12) case_expr@0 = 3 9set str@1'3' 10 jump 12 11set str@1'unknown' 12 stmt 0"SELECT str"
SHOW PROCEDURE CODE proc_19194_searched;
Pos Instruction 0set str@1 NULL 1 jump_if_not 4(11) i@0 = 1 2set str@1'1' 3 jump 11 4 jump_if_not 7(11) i@0 = 2 5set str@1'2' 6 jump 11 7 jump_if_not 10(11) i@0 = 3 8set str@1'3' 9 jump 11 10set str@1'unknown' 11 stmt 0"SELECT str"
SHOW PROCEDURE CODE proc_19194_nested_1;
Pos Instruction 0set str_i@2 NULL 1set str_j@3 NULL 2 set_case_expr (27) 0 i@0 3 jump_if_not 6(27) case_expr@0 = 10 4set str_i@2'10' 5 jump 27 6 jump_if_not 20(27) case_expr@0 = 20 7set str_i@2'20' 8 jump_if_not 11(18) j@1 = 1 9set str_j@3'1' 10 jump 18 11 jump_if_not 14(18) j@1 = 2 12set str_j@3'2' 13 jump 18 14 jump_if_not 17(18) j@1 = 3 15set str_j@3'3' 16 jump 18 17set str_j@3'unknown' 18 stmt 0"select "i was 20"" 19 jump 27 20 jump_if_not 23(27) case_expr@0 = 30 21set str_i@2'30' 22 jump 27 23 jump_if_not 26(27) case_expr@0 = 40 24set str_i@2'40' 25 jump 27 26set str_i@2'unknown' 27 stmt 0"SELECT str_i, str_j"
SHOW PROCEDURE CODE proc_19194_nested_2;
Pos Instruction 0set str_i@2 NULL 1set str_j@3 NULL 2 jump_if_not 5(27) i@0 = 10 3set str_i@2'10' 4 jump 27 5 jump_if_not 20(27) i@0 = 20 6set str_i@2'20' 7 set_case_expr (18) 0 j@1 8 jump_if_not 11(18) case_expr@0 = 1 9set str_j@3'1' 10 jump 18 11 jump_if_not 14(18) case_expr@0 = 2 12set str_j@3'2' 13 jump 18 14 jump_if_not 17(18) case_expr@0 = 3 15set str_j@3'3' 16 jump 18 17set str_j@3'unknown' 18 stmt 0"select "i was 20"" 19 jump 27 20 jump_if_not 23(27) i@0 = 30 21set str_i@2'30' 22 jump 27 23 jump_if_not 26(27) i@0 = 40 24set str_i@2'40' 25 jump 27 26set str_i@2'unknown' 27 stmt 0"SELECT str_i, str_j"
SHOW PROCEDURE CODE proc_19194_nested_3;
Pos Instruction 0set str_i@2 NULL 1set str_j@3 NULL 2 set_case_expr (28) 0 i@0 3 jump_if_not 6(28) case_expr@0 = 10 4set str_i@2'10' 5 jump 28 6 jump_if_not 21(28) case_expr@0 = 20 7set str_i@2'20' 8 set_case_expr (19) 1 j@1 9 jump_if_not 12(19) case_expr@1 = 1 10set str_j@3'1' 11 jump 19 12 jump_if_not 15(19) case_expr@1 = 2 13set str_j@3'2' 14 jump 19 15 jump_if_not 18(19) case_expr@1 = 3 16set str_j@3'3' 17 jump 19 18set str_j@3'unknown' 19 stmt 0"select "i was 20"" 20 jump 28 21 jump_if_not 24(28) case_expr@0 = 30 22set str_i@2'30' 23 jump 28 24 jump_if_not 27(28) case_expr@0 = 40 25set str_i@2'40' 26 jump 28 27set str_i@2'unknown' 28 stmt 0"SELECT str_i, str_j"
SHOW PROCEDURE CODE proc_19194_nested_4;
Pos Instruction 0set str_i@2 NULL 1set str_j@3 NULL 2 jump_if_not 5(26) i@0 = 10 3set str_i@2'10' 4 jump 26 5 jump_if_not 19(26) i@0 = 20 6set str_i@2'20' 7 jump_if_not 10(17) j@1 = 1 8set str_j@3'1' 9 jump 17 10 jump_if_not 13(17) j@1 = 2 11set str_j@3'2' 12 jump 17 13 jump_if_not 16(17) j@1 = 3 14set str_j@3'3' 15 jump 17 16set str_j@3'unknown' 17 stmt 0"select "i was 20"" 18 jump 26 19 jump_if_not 22(26) i@0 = 30 20set str_i@2'30' 21 jump 26 22 jump_if_not 25(26) i@0 = 40 23set str_i@2'40' 24 jump 26 25set str_i@2'unknown' 26 stmt 0"SELECT str_i, str_j"
CALL proc_19194_nested_1(10, 1);
str_i str_j 10 NULL
CALL proc_19194_nested_1(25, 1);
str_i str_j
unknown NULL
CALL proc_19194_nested_1(20, 1);
i was 20
i was 20
str_i str_j 201
CALL proc_19194_nested_1(20, 2);
i was 20
i was 20
str_i str_j 202
CALL proc_19194_nested_1(20, 3);
i was 20
i was 20
str_i str_j 203
CALL proc_19194_nested_1(20, 4);
i was 20
i was 20
str_i str_j 20 unknown
CALL proc_19194_nested_1(30, 1);
str_i str_j 30 NULL
CALL proc_19194_nested_1(40, 1);
str_i str_j 40 NULL
CALL proc_19194_nested_1(0, 0);
str_i str_j
unknown NULL
CALL proc_19194_nested_2(10, 1);
str_i str_j 10 NULL
CALL proc_19194_nested_2(25, 1);
str_i str_j
unknown NULL
CALL proc_19194_nested_2(20, 1);
i was 20
i was 20
str_i str_j 201
CALL proc_19194_nested_2(20, 2);
i was 20
i was 20
str_i str_j 202
CALL proc_19194_nested_2(20, 3);
i was 20
i was 20
str_i str_j 203
CALL proc_19194_nested_2(20, 4);
i was 20
i was 20
str_i str_j 20 unknown
CALL proc_19194_nested_2(30, 1);
str_i str_j 30 NULL
CALL proc_19194_nested_2(40, 1);
str_i str_j 40 NULL
CALL proc_19194_nested_2(0, 0);
str_i str_j
unknown NULL
CALL proc_19194_nested_3(10, 1);
str_i str_j 10 NULL
CALL proc_19194_nested_3(25, 1);
str_i str_j
unknown NULL
CALL proc_19194_nested_3(20, 1);
i was 20
i was 20
str_i str_j 201
CALL proc_19194_nested_3(20, 2);
i was 20
i was 20
str_i str_j 202
CALL proc_19194_nested_3(20, 3);
i was 20
i was 20
str_i str_j 203
CALL proc_19194_nested_3(20, 4);
i was 20
i was 20
str_i str_j 20 unknown
CALL proc_19194_nested_3(30, 1);
str_i str_j 30 NULL
CALL proc_19194_nested_3(40, 1);
str_i str_j 40 NULL
CALL proc_19194_nested_3(0, 0);
str_i str_j
unknown NULL
CALL proc_19194_nested_4(10, 1);
str_i str_j 10 NULL
CALL proc_19194_nested_4(25, 1);
str_i str_j
unknown NULL
CALL proc_19194_nested_4(20, 1);
i was 20
i was 20
str_i str_j 201
CALL proc_19194_nested_4(20, 2);
i was 20
i was 20
str_i str_j 202
CALL proc_19194_nested_4(20, 3);
i was 20
i was 20
str_i str_j 203
CALL proc_19194_nested_4(20, 4);
i was 20
i was 20
str_i str_j 20 unknown
CALL proc_19194_nested_4(30, 1);
str_i str_j 30 NULL
CALL proc_19194_nested_4(40, 1);
str_i str_j 40 NULL
CALL proc_19194_nested_4(0, 0);
str_i str_j
unknown NULL
DROP PROCEDURE proc_19194_simple;
DROP PROCEDURE proc_19194_searched;
DROP PROCEDURE proc_19194_nested_1;
DROP PROCEDURE proc_19194_nested_2;
DROP PROCEDURE proc_19194_nested_3;
DROP PROCEDURE proc_19194_nested_4;
DROP PROCEDURE IF EXISTS p1;
CREATE PROCEDURE p1() CREATE INDEX idx ON t1 (c1);
SHOW PROCEDURE CODE p1;
Pos Instruction 0 stmt 2"CREATE INDEX idx ON t1 (c1)"
DROP PROCEDURE p1;
drop table if exists t1;
drop procedure if exists proc_26977_broken;
drop procedure if exists proc_26977_works;
create table t1(a int unique);
create procedure proc_26977_broken(v int)
begin
declare i int default 5;
declare continue handler for sqlexception
begin
select 'caught something';
retry:
while i > 0 do
begin set i = i - 1;
select 'looping', i;
end;
end while retry;
end;
select 'do something';
insert into t1 values (v);
select 'do something again';
insert into t1 values (v);
end//
create procedure proc_26977_works(v int)
begin
declare i int default 5;
declare continue handler for sqlexception
begin
select 'caught something';
retry:
while i > 0 do
begin set i = i - 1;
select 'looping', i;
end;
end while retry;
select 'optimizer: keep hreturn';
end;
select 'do something';
insert into t1 values (v);
select 'do something again';
insert into t1 values (v);
end//
show procedure code proc_26977_broken;
Pos Instruction 0set i@15 1 hpush_jump 82 CONTINUE 2 stmt 0"select 'caught something'" 3 jump_if_not 7(7) i@1 > 0 4set i@1 i@1 - 1 5 stmt 0"select 'looping', i" 6 jump 3 7 hreturn 2 8 stmt 0"select 'do something'" 9 stmt 5"insert into t1 values (v)" 10 stmt 0"select 'do something again'" 11 stmt 5"insert into t1 values (v)" 12 hpop 1
show procedure code proc_26977_works;
Pos Instruction 0set i@15 1 hpush_jump 92 CONTINUE 2 stmt 0"select 'caught something'" 3 jump_if_not 7(7) i@1 > 0 4set i@1 i@1 - 1 5 stmt 0"select 'looping', i" 6 jump 3 7 stmt 0"select 'optimizer: keep hreturn'" 8 hreturn 2 9 stmt 0"select 'do something'" 10 stmt 5"insert into t1 values (v)" 11 stmt 0"select 'do something again'" 12 stmt 5"insert into t1 values (v)" 13 hpop 1
call proc_26977_broken(1);
do something
do something
do something again
do something again
caught something
caught something
looping i
looping 4
looping i
looping 3
looping i
looping 2
looping i
looping 1
looping i
looping 0
call proc_26977_works(2);
do something
do something
do something again
do something again
caught something
caught something
looping i
looping 4
looping i
looping 3
looping i
looping 2
looping i
looping 1
looping i
looping 0
optimizer: keep hreturn
optimizer: keep hreturn
drop table t1;
drop procedure proc_26977_broken;
drop procedure proc_26977_works;
drop procedure if exists proc_33618_h;
drop procedure if exists proc_33618_c;
create procedure proc_33618_h(num int)
begin
declare count1 int default '0';
declare vb varchar(30);
declare last_row int;
while(num>=1) do set num=num-1;
begin
declare cur1 cursor for select `a` from t_33618;
declare continue handler for not found set last_row = 1; set last_row:=0;
open cur1;
rep1:
repeat
begin
declare exit handler for 1062 begin end;
fetch cur1 into vb; if (last_row = 1) then
## should generate a hpop instruction here
leave rep1;
end if;
end;
until last_row=1
end repeat;
close cur1;
end;
end while;
end//
create procedure proc_33618_c(num int)
begin
declare count1 int default '0';
declare vb varchar(30);
declare last_row int;
while(num>=1) do set num=num-1;
begin
declare cur1 cursor for select `a` from t_33618;
declare continue handler for not found set last_row = 1; set last_row:=0;
open cur1;
rep1:
repeat
begin
declare cur2 cursor for select `b` from t_33618;
fetch cur1 into vb; if (last_row = 1) then
## should generate a cpop instruction here
leave rep1;
end if;
end;
until last_row=1
end repeat;
close cur1;
end;
end while;
end//
show procedure code proc_33618_h;
Pos Instruction 0set count1@1'0' 1set vb@2 NULL 2set last_row@3 NULL 3 jump_if_not 24(24) num@0 >= 1 4set num@0 num@0 - 1 5 cpush cur1@0 6 hpush_jump 94 CONTINUE 7set last_row@31 8 hreturn 4 9set last_row@30 10 copen cur1@0 11 hpush_jump 134 EXIT 12 hreturn 017 13 cfetch cur1@0 vb@2 14 jump_if_not 17(17) last_row@3 = 1 15 hpop 1 16 jump 19 17 hpop 1 18 jump_if_not 11(19) last_row@3 = 1 19 cclose cur1@0 20 hpop 1 21 cpop 1 22 jump 3
show procedure code proc_33618_c;
Pos Instruction 0set count1@1'0' 1set vb@2 NULL 2set last_row@3 NULL 3 jump_if_not 23(23) num@0 >= 1 4set num@0 num@0 - 1 5 cpush cur1@0 6 hpush_jump 94 CONTINUE 7set last_row@31 8 hreturn 4 9set last_row@30 10 copen cur1@0 11 cpush cur2@1 12 cfetch cur1@0 vb@2 13 jump_if_not 16(16) last_row@3 = 1 14 cpop 1 15 jump 18 16 cpop 1 17 jump_if_not 11(18) last_row@3 = 1 18 cclose cur1@0 19 hpop 1 20 cpop 1 21 jump 3
drop procedure proc_33618_h;
drop procedure proc_33618_c;
drop procedure if exists p_20906_a;
drop procedure if exists p_20906_b;
create procedure p_20906_a() SET @a=@a+1, @b=@b+1;
show procedure code p_20906_a;
Pos Instruction 0 stmt 31"SET @a=@a+1" 1 stmt 31"SET @b=@b+1" set @a=1; set @b=1;
call p_20906_a();
select @a, @b;
@a @b 22
create procedure p_20906_b() SET @a=@a+1, @b=@b+1, @c=@c+1;
show procedure code p_20906_b;
Pos Instruction 0 stmt 31"SET @a=@a+1" 1 stmt 31"SET @b=@b+1" 2 stmt 31"SET @c=@c+1" set @a=1; set @b=1; set @c=1;
call p_20906_b();
select @a, @b, @c;
@a @b @c 222
drop procedure p_20906_a;
drop procedure p_20906_b;
End of 5.0 tests.
CREATE PROCEDURE p1()
BEGIN
DECLARE dummy int default 0; CASE12
WHEN 12
THEN SET dummy = 0;
END CASE;
END//
SHOW PROCEDURE CODE p1;
Pos Instruction 0set dummy@00 1 set_case_expr (6) 012 2 jump_if_not 5(6) case_expr@0 = 12 3set dummy@00 4 jump 6 5error1339
DROP PROCEDURE p1;
#
# Bug#23032: Handlers declared in a SP do not handle warnings generated in sub-SP
#
# - Case4: check that "No Data trumps Warning".
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (1), (2), (3);
CREATE PROCEDURE p1()
BEGIN
DECLARE c CURSOR FOR SELECT a FROM t1;
OPEN c;
BEGIN
DECLARE v INT;
DECLARE CONTINUE HANDLER FOR SQLWARNING
BEGIN
SELECT "Warning found!";
SHOW WARNINGS;
END;
DECLARE EXIT HANDLER FOR NOT FOUND
BEGIN
SELECT "End of Result Set found!";
SHOW WARNINGS;
END;
WHILE TRUE DO
FETCH c INTO v;
END WHILE;
END;
CLOSE c;
SELECT a INTO @foo FROM t1 LIMIT 1; # Clear warning stack
END| SET @save_dbug = @@debug_dbug; SET SESSION debug_dbug="+d,bug23032_emit_warning";
CALL p1();
Warning found!
Warning found!
Level Code Message
Warning 1105 Unknown error
Warning found!
Warning found!
Level Code Message
Warning 1105 Unknown error
Warning found!
Warning found!
Level Code Message
Warning 1105 Unknown error
End of Result Set found!
End of Result Set found!
Level Code Message
Warning 1105 Unknown error Error1329 No data - zero rows fetched, selected, or processed SET SESSION debug_dbug=@save_dbug;
DROP PROCEDURE p1;
DROP TABLE t1;
#
# Bug#11763507 - 56224: FUNCTION NAME IS CASE-SENSITIVE
# SET @@SQL_MODE = '';
CREATE FUNCTION testf_bug11763507() RETURNS INT
BEGIN RETURN0;
END
$
CREATE PROCEDURE testp_bug11763507()
BEGIN
SELECT "PROCEDURE testp_bug11763507";
END
$
SHOW FUNCTION CODE testf_bug11763507;
Pos Instruction 0 freturn int 0
SHOW FUNCTION CODE TESTF_bug11763507;
Pos Instruction 0 freturn int 0
SHOW PROCEDURE CODE testp_bug11763507;
Pos Instruction 0 stmt 0"SELECT "PROCEDURE testp_bug11763507""
SHOW PROCEDURE CODE TESTP_bug11763507;
Pos Instruction 0 stmt 0"SELECT "PROCEDURE testp_bug11763507""
DROP PROCEDURE testp_bug11763507;
DROP FUNCTION testf_bug11763507;
#END OF BUG#11763507 test.
#
# MDEV-23408 Wrong result upon query from I_S and further Assertion `!alias_arg || strlen(alias_arg->str) == alias_arg->length' failed with certain connection charset
# SET NAMES utf8; SET SESSION character_set_connection=latin1;
CREATE PROCEDURE p1()
BEGIN
DECLARE a VARCHAR(10) CHARACTER SET utf8; SET a='ä';
SELECT a, 'ä' AS b;
END;
$$
SHOW PROCEDURE CODE p1;
Pos Instruction 0set a@0 NULL 1set a@0'ä' 2 stmt 0"SELECT a, 'ä' AS b"
CALL p1;
a b
ä ä
DROP PROCEDURE p1;
#
# End of 10.2 tests
#
#
# MDEV-13581 ROW TYPE OF t1 and t1%ROWTYPE for routine parameters
#
CREATE TABLE t1 (a INT, b TEXT);
CREATE PROCEDURE p1(a ROW TYPE OF t1, OUT b ROW TYPE OF t1)
BEGIN SET a.a = 100; SET a.b = 'aaa'; SET b.a = 200; SET b.b = 'bbb'; SET a = b; SET b = a; SET a.a = b.a; SET b.a = a.a;
END;
$$
SHOW PROCEDURE CODE p1;
Pos Instruction 0set a.a@0["a"] 100 1set a.b@0["b"] 'aaa' 2set b.a@1["a"] 200 3set b.b@1["b"] 'bbb' 4set a@0 b@1 5set b@1 a@0 6set a.a@0["a"] b.a@1["a"] 7set b.a@1["a"] a.a@0["a"]
DROP PROCEDURE p1;
DROP TABLE t1;
#
# MDEV-14415 Add Oracle-style FOR loop to sql_mode=DEFAULT
#
# Integer range FOR loop
CREATE PROCEDURE p1()
BEGIN
FOR i IN 1..3
DO
SELECT i;
END FOR;
END;
$$
CALL p1;
i 1
i 2
i 3
SHOW PROCEDURE CODE p1;
Pos Instruction 0set i@01 1set [target_bound]@13 2 jump_if_not 6(6) i@0 <= [target_bound]@1 3 stmt 0"SELECT i" 4set i@0 i@0 + 1 5 jump 2
DROP PROCEDURE p1;
# Nested integer range FOR loops
CREATE PROCEDURE p1()
BEGIN
fori:
FOR i IN 1..3
DO
forj:
FOR j IN 1..3
DO IF i = 3 THEN
LEAVE fori;
END IF; IF j = 3 THEN
LEAVE forj;
END IF;
SELECT i,j;
END FOR;
END FOR;
END;
$$
CALL p1;
i j 11
i j 12
i j 21
i j 22
SHOW PROCEDURE CODE p1;
Pos Instruction 0set i@01 1set [target_bound]@13 2 jump_if_not 17(17) i@0 <= [target_bound]@1 3set j@21 4set [target_bound]@33 5 jump_if_not 13(13) j@2 <= [target_bound]@3 6 jump_if_not 8(8) i@0 = 3 7 jump 17 8 jump_if_not 10(10) j@2 = 3 9 jump 13 10 stmt 0"SELECT i,j" 11set j@2 j@2 + 1 12 jump 5 13set i@0 i@0 + 1 14 jump 2
DROP PROCEDURE p1;
# Explicit cursor FOR loops
CREATE PROCEDURE p1()
BEGIN
DECLARE cur0 CURSOR FOR SELECT 10 AS a, 'b0' AS b;
DECLARE cur1 CURSOR FOR SELECT 10 AS a, 'b0' AS b;
DECLARE cur2 CURSOR FOR SELECT 10 AS a, 'b0' AS b;
FOR rec1 IN cur1
DO
SELECT rec1.a, rec1.b; SET rec1.a= 11; SET rec1.b= 'b1';
SELECT rec1.a, rec1.b;
END FOR;
FOR rec0 IN cur0
DO SET rec0.a= 10; SET rec0.b='b0';
END FOR;
FOR rec2 IN cur2
DO SET rec2.a= 10; SET rec2.b='b0';
END FOR;
END;
$$
SHOW PROCEDURE CODE p1;
Pos Instruction 0 cpush cur0@0 1 cpush cur1@1 2 cpush cur2@2 3 cursor_copy_struct cur1 rec1@0 4 copen cur1@1 5 cfetch cur1@1 rec1@0 6 jump_if_not 13(13) `cur1`%FOUND 7 stmt 0"SELECT rec1.a, rec1.b" 8set rec1.a@0["a"] 11 9set rec1.b@0["b"] 'b1' 10 stmt 0"SELECT rec1.a, rec1.b" 11 cfetch cur1@1 rec1@0 12 jump 6 13 cclose cur1@1 14 cursor_copy_struct cur0 rec0@1 15 copen cur0@0 16 cfetch cur0@0 rec0@1 17 jump_if_not 22(22) `cur0`%FOUND 18set rec0.a@1["a"] 10 19set rec0.b@1["b"] 'b0' 20 cfetch cur0@0 rec0@1 21 jump 17 22 cclose cur0@0 23 cursor_copy_struct cur2 rec2@2 24 copen cur2@2 25 cfetch cur2@2 rec2@2 26 jump_if_not 31(31) `cur2`%FOUND 27set rec2.a@2["a"] 10 28set rec2.b@2["b"] 'b0' 29 cfetch cur2@2 rec2@2 30 jump 26 31 cclose cur2@2 32 cpop 3
DROP PROCEDURE p1;
# Nested explicit cursor FOR loops
CREATE PROCEDURE p1()
BEGIN
DECLARE cur0 CURSOR FOR SELECT 10 AS a, 'b0' AS b;
FOR rec0 IN cur0
DO
BEGIN
DECLARE cur1 CURSOR FOR SELECT 11 AS a, 'b1' AS b; SET rec0.a= 11; SET rec0.b= 'b0';
FOR rec1 IN cur1
DO SET rec1.a= 11; SET rec1.b= 'b1';
BEGIN
DECLARE cur2 CURSOR FOR SELECT 12 AS a, 'b2' AS b;
FOR rec2 IN cur2
DO SET rec2.a=12; SET rec2.b='b2';
END FOR;
END;
END FOR;
END;
END FOR;
END;
$$
SHOW PROCEDURE CODE p1;
Pos Instruction 0 cpush cur0@0 1 cursor_copy_struct cur0 rec0@0 2 copen cur0@0 3 cfetch cur0@0 rec0@0 4 jump_if_not 31(31) `cur0`%FOUND 5 cpush cur1@1 6set rec0.a@0["a"] 11 7set rec0.b@0["b"] 'b0' 8 cursor_copy_struct cur1 rec1@1 9 copen cur1@1 10 cfetch cur1@1 rec1@1 11 jump_if_not 27(27) `cur1`%FOUND 12set rec1.a@1["a"] 11 13set rec1.b@1["b"] 'b1' 14 cpush cur2@2 15 cursor_copy_struct cur2 rec2@2 16 copen cur2@2 17 cfetch cur2@2 rec2@2 18 jump_if_not 23(23) `cur2`%FOUND 19set rec2.a@2["a"] 12 20set rec2.b@2["b"] 'b2' 21 cfetch cur2@2 rec2@2 22 jump 18 23 cclose cur2@2 24 cpop 1 25 cfetch cur1@1 rec1@1 26 jump 11 27 cclose cur1@1 28 cpop 1 29 cfetch cur0@0 rec0@0 30 jump 4 31 cclose cur0@0 32 cpop 1
DROP PROCEDURE p1;
# Implicit cursor FOR loops
CREATE PROCEDURE p1()
BEGIN
FOR rec1 IN (SELECT 11 AS a, 'b1' AS b)
DO
SELECT rec1.a, rec1.b; SET rec1.a= 11; SET rec1.b= 'b1';
SELECT rec1.a, rec1.b;
END FOR;
FOR rec0 IN (SELECT 10 AS a, 'b0' AS b)
DO SET rec0.a= 10; SET rec0.b='b0';
END FOR;
FOR rec2 IN (SELECT 12 AS a, 'b2' AS b)
DO SET rec2.a= 10; SET rec2.b='b0';
END FOR;
END;
$$
SHOW PROCEDURE CODE p1;
Pos Instruction 0 cpush [implicit_cursor]@0 1 cursor_copy_struct [implicit_cursor] rec1@0 2 copen [implicit_cursor]@0 3 cfetch [implicit_cursor]@0 rec1@0 4 jump_if_not 11(11) `[implicit_cursor]`%FOUND 5 stmt 0"SELECT rec1.a, rec1.b" 6set rec1.a@0["a"] 11 7set rec1.b@0["b"] 'b1' 8 stmt 0"SELECT rec1.a, rec1.b" 9 cfetch [implicit_cursor]@0 rec1@0 10 jump 4 11 cpop 1 12 cpush [implicit_cursor]@0 13 cursor_copy_struct [implicit_cursor] rec0@1 14 copen [implicit_cursor]@0 15 cfetch [implicit_cursor]@0 rec0@1 16 jump_if_not 21(21) `[implicit_cursor]`%FOUND 17set rec0.a@1["a"] 10 18set rec0.b@1["b"] 'b0' 19 cfetch [implicit_cursor]@0 rec0@1 20 jump 16 21 cpop 1 22 cpush [implicit_cursor]@0 23 cursor_copy_struct [implicit_cursor] rec2@2 24 copen [implicit_cursor]@0 25 cfetch [implicit_cursor]@0 rec2@2 26 jump_if_not 31(31) `[implicit_cursor]`%FOUND 27set rec2.a@2["a"] 10 28set rec2.b@2["b"] 'b0' 29 cfetch [implicit_cursor]@0 rec2@2 30 jump 26 31 cpop 1
DROP PROCEDURE p1;
# Nested implicit cursor FOR loops
CREATE PROCEDURE p1()
BEGIN
FOR rec0 IN (SELECT 10 AS a, 'b0' AS b)
DO SET rec0.a= 11; SET rec0.b= 'b0';
FOR rec1 IN (SELECT 11 AS a, 'b1' AS b)
DO SET rec1.a= 11; SET rec1.b= 'b1';
FOR rec2 IN (SELECT 12 AS a, 'b2' AS b)
DO SET rec2.a=12; SET rec2.b='b2';
END FOR;
END FOR;
END FOR;
END;
$$
SHOW PROCEDURE CODE p1;
Pos Instruction 0 cpush [implicit_cursor]@0 1 cursor_copy_struct [implicit_cursor] rec0@0 2 copen [implicit_cursor]@0 3 cfetch [implicit_cursor]@0 rec0@0 4 jump_if_not 29(29) `[implicit_cursor]`%FOUND 5set rec0.a@0["a"] 11 6set rec0.b@0["b"] 'b0' 7 cpush [implicit_cursor]@1 8 cursor_copy_struct [implicit_cursor] rec1@1 9 copen [implicit_cursor]@1 10 cfetch [implicit_cursor]@1 rec1@1 11 jump_if_not 26(26) `[implicit_cursor]`%FOUND 12set rec1.a@1["a"] 11 13set rec1.b@1["b"] 'b1' 14 cpush [implicit_cursor]@2 15 cursor_copy_struct [implicit_cursor] rec2@2 16 copen [implicit_cursor]@2 17 cfetch [implicit_cursor]@2 rec2@2 18 jump_if_not 23(23) `[implicit_cursor]`%FOUND 19set rec2.a@2["a"] 12 20set rec2.b@2["b"] 'b2' 21 cfetch [implicit_cursor]@2 rec2@2 22 jump 18 23 cpop 1 24 cfetch [implicit_cursor]@1 rec1@1 25 jump 11 26 cpop 1 27 cfetch [implicit_cursor]@0 rec0@0 28 jump 4 29 cpop 1
DROP PROCEDURE p1;
#
# MDEV-14623: Output of show function code does not show FETCH GROUP NEXT ROW
# for custom aggregates
#
create aggregate function f1(x INT) returns int
begin
declare continue handler for not found return0; loop
fetch group next row;
insert into t2 (sal) values (x);
end loop;
end|
show function code f1;
Pos Instruction 0 hpush_jump 21 CONTINUE 1 freturn int 0 2 agg_cfetch 3 stmt 5"insert into t2 (sal) values (x)" 4 jump 2 5 hpop 1
drop function f1;
#
# End of 10.3 tests
#
#
# Start of 10.4 tests
#
#
# MDEV-32275 getting error'Illegal parameter data types row and bigint for operation '+' ' when using ITERATE in a FOR..DO
#
#
# Unlabeled FOR/cursor with a nested labeled LOOP inside
#
CREATE ORREPLACE PROCEDURE p1()
BEGIN
DECLARE loopDone TINYINT DEFAULT FALSE;
FOR _row IN (SELECT '' AS a) DO
SELECT 'start of outerLoop';
innerLoop: LOOP
SELECT 'start of innerLoop'; IF loopDone THEN
LEAVE innerLoop;
END IF; SET loopDone = TRUE; IF _row.a = 'v1'
THEN
SELECT 'start of THEN block';
ITERATE innerLoop;
END IF;
SELECT 'end of innerLoop';
END LOOP;
SELECT 'end of outerLoop';
END FOR;
END
$$
SHOW PROCEDURE CODE p1;
Pos Instruction 0set loopDone@00 1 cpush [implicit_cursor]@0 2 cursor_copy_struct [implicit_cursor] _row@1 3 copen [implicit_cursor]@0 4 cfetch [implicit_cursor]@0 _row@1 5 jump_if_not 19(19) `[implicit_cursor]`%FOUND 6 stmt 0"SELECT 'start of outerLoop'" 7 stmt 0"SELECT 'start of innerLoop'" 8 jump_if_not 10(10) loopDone@0 9 jump 16 10set loopDone@01 11 jump_if_not 14(14) _row.a@1["a"] = 'v1' 12 stmt 0"SELECT 'start of THEN block'" 13 jump 7 14 stmt 0"SELECT 'end of innerLoop'" 15 jump 7 16 stmt 0"SELECT 'end of outerLoop'" 17 cfetch [implicit_cursor]@0 _row@1 18 jump 5 19 cpop 1
DROP PROCEDURE p1;
#
# Labeled FOR/cursor with a nested labeled LOOP
#
CREATE ORREPLACE PROCEDURE p1()
BEGIN
DECLARE loopDone TINYINT DEFAULT FALSE;
outerLoop:
FOR _row IN (SELECT '' AS a) DO
SELECT 'start of outerLoop';
innerLoop: LOOP
SELECT 'start of innerLoop'; IF loopDone THEN
LEAVE innerLoop;
END IF; SET loopDone = TRUE; IF _row.a = 'v1'
THEN
SELECT 'start of IF/v1/THEN block';
ITERATE innerLoop;
END IF; IF _row.a = 'v2'
THEN
SELECT 'start of IF/v2/THEN block';
ITERATE outerLoop;
END IF;
SELECT 'end of innerLoop';
END LOOP;
SELECT 'end of outerLoop';
END FOR;
END
$$
SHOW PROCEDURE CODE p1;
Pos Instruction 0set loopDone@00 1 cpush [implicit_cursor]@0 2 cursor_copy_struct [implicit_cursor] _row@1 3 copen [implicit_cursor]@0 4 cfetch [implicit_cursor]@0 _row@1 5 jump_if_not 23(23) `[implicit_cursor]`%FOUND 6 stmt 0"SELECT 'start of outerLoop'" 7 stmt 0"SELECT 'start of innerLoop'" 8 jump_if_not 10(10) loopDone@0 9 jump 20 10set loopDone@01 11 jump_if_not 14(14) _row.a@1["a"] = 'v1' 12 stmt 0"SELECT 'start of IF/v1/THEN block'" 13 jump 7 14 jump_if_not 18(18) _row.a@1["a"] = 'v2' 15 stmt 0"SELECT 'start of IF/v2/THEN block'" 16 cfetch [implicit_cursor]@0 _row@1 17 jump 5 18 stmt 0"SELECT 'end of innerLoop'" 19 jump 7 20 stmt 0"SELECT 'end of outerLoop'" 21 cfetch [implicit_cursor]@0 _row@1 22 jump 5 23 cpop 1
DROP PROCEDURE p1;
#
# Unlabeled FOR/integer with a labeled LOOP inside
#
CREATE ORREPLACE PROCEDURE p1()
BEGIN
DECLARE loopDone TINYINT DEFAULT FALSE;
FOR _index IN 1..10 DO
SELECT 'start of outerLoop';
innerLoop: LOOP
SELECT 'start of innerLoop'; IF loopDone THEN
LEAVE innerLoop;
END IF; SET loopDone = TRUE; IF _index = 1
THEN
SELECT 'start of THEN block';
ITERATE innerLoop;
END IF;
SELECT 'end of innerLoop';
END LOOP;
SELECT 'end of outerLoop';
END FOR;
END
$$
SHOW PROCEDURE CODE p1;
Pos Instruction 0set loopDone@00 1set _index@11 2set [target_bound]@210 3 jump_if_not 19(19) _index@1 <= [target_bound]@2 4 stmt 0"SELECT 'start of outerLoop'" 5 stmt 0"SELECT 'start of innerLoop'" 6 jump_if_not 8(8) loopDone@0 7 jump 14 8set loopDone@01 9 jump_if_not 12(12) _index@1 = 1 10 stmt 0"SELECT 'start of THEN block'" 11 jump 5 12 stmt 0"SELECT 'end of innerLoop'" 13 jump 5 14 stmt 0"SELECT 'end of outerLoop'" 15set _index@1 _index@1 + 1 16 jump 3
DROP PROCEDURE p1;
#
# Labeled FOR/integer with a labeled LOOP inside
#
CREATE ORREPLACE PROCEDURE p1()
BEGIN
DECLARE loopDone TINYINT DEFAULT FALSE;
outerLoop:
FOR _index IN 1..10 DO
SELECT 'start of outerLoop';
innerLoop: LOOP
SELECT 'start of innerLoop'; IF loopDone THEN
LEAVE innerLoop;
END IF; SET loopDone = TRUE; IF _index = 1
THEN
SELECT 'start of IF/1/THEN block';
ITERATE innerLoop;
END IF; IF _index = 2
THEN
SELECT 'start of IF/2/THEN block';
ITERATE outerLoop;
END IF;
SELECT 'end of innerLoop';
END LOOP;
SELECT 'end of outerLoop';
END FOR;
END
$$
SHOW PROCEDURE CODE p1;
Pos Instruction 0set loopDone@00 1set _index@11 2set [target_bound]@210 3 jump_if_not 24(24) _index@1 <= [target_bound]@2 4 stmt 0"SELECT 'start of outerLoop'" 5 stmt 0"SELECT 'start of innerLoop'" 6 jump_if_not 8(8) loopDone@0 7 jump 18 8set loopDone@01 9 jump_if_not 12(12) _index@1 = 1 10 stmt 0"SELECT 'start of IF/1/THEN block'" 11 jump 5 12 jump_if_not 16(16) _index@1 = 2 13 stmt 0"SELECT 'start of IF/2/THEN block'" 14set _index@1 _index@1 + 1 15 jump 3 16 stmt 0"SELECT 'end of innerLoop'" 17 jump 5 18 stmt 0"SELECT 'end of outerLoop'" 19set _index@1 _index@1 + 1 20 jump 3
DROP PROCEDURE p1;
#
# Unlabeled FOR/integer with a labeled FOR inside
#
CREATE ORREPLACE PROCEDURE p1()
BEGIN
DECLARE loopDone TINYINT DEFAULT FALSE;
FOR _index_outer IN 1..10 DO
SELECT 'start of outerLoop';
innerLoop:
FOR _index_inner IN 1..10 DO
SELECT 'start of innerLoop'; IF loopDone THEN
LEAVE innerLoop;
END IF; SET loopDone = TRUE; IF _index_inner = 1
THEN
SELECT 'start of IF/1/THEN block';
ITERATE innerLoop;
END IF;
SELECT 'end of innerLoop';
END FOR;
SELECT 'end of outerLoop';
END FOR;
END
$$
SHOW PROCEDURE CODE p1;
Pos Instruction 0set loopDone@00 1set _index_outer@11 2set [target_bound]@210 3 jump_if_not 24(24) _index_outer@1 <= [target_bound]@2 4 stmt 0"SELECT 'start of outerLoop'" 5set _index_inner@31 6set [target_bound]@410 7 jump_if_not 19(19) _index_inner@3 <= [target_bound]@4 8 stmt 0"SELECT 'start of innerLoop'" 9 jump_if_not 11(11) loopDone@0 10 jump 19 11set loopDone@01 12 jump_if_not 16(16) _index_inner@3 = 1 13 stmt 0"SELECT 'start of IF/1/THEN block'" 14set _index_inner@3 _index_inner@3 + 1 15 jump 7 16 stmt 0"SELECT 'end of innerLoop'" 17set _index_inner@3 _index_inner@3 + 1 18 jump 7 19 stmt 0"SELECT 'end of outerLoop'" 20set _index_outer@1 _index_outer@1 + 1 21 jump 3
DROP PROCEDURE p1;
#
# Labeled FOR/integer with a labeled FOR inside
#
CREATE ORREPLACE PROCEDURE p1()
BEGIN
DECLARE loopDone TINYINT DEFAULT FALSE;
outerLoop:
FOR _index_outer IN 1..10 DO
SELECT 'start of outerLoop';
innerLoop:
FOR _index_inner IN 1..10 DO
SELECT 'start of innerLoop'; IF loopDone THEN
LEAVE innerLoop;
END IF; SET loopDone = TRUE; IF _index_inner = 1
THEN
SELECT 'start of IF/1/THEN block';
ITERATE innerLoop;
END IF; IF _index_inner = 2
THEN
SELECT 'start of IF/2/THEN block';
ITERATE outerLoop;
END IF;
SELECT 'end of innerLoop';
END FOR;
SELECT 'end of outerLoop';
END FOR;
END
$$
SHOW PROCEDURE CODE p1;
Pos Instruction 0set loopDone@00 1set _index_outer@11 2set [target_bound]@210 3 jump_if_not 29(29) _index_outer@1 <= [target_bound]@2 4 stmt 0"SELECT 'start of outerLoop'" 5set _index_inner@31 6set [target_bound]@410 7 jump_if_not 23(23) _index_inner@3 <= [target_bound]@4 8 stmt 0"SELECT 'start of innerLoop'" 9 jump_if_not 11(11) loopDone@0 10 jump 23 11set loopDone@01 12 jump_if_not 16(16) _index_inner@3 = 1 13 stmt 0"SELECT 'start of IF/1/THEN block'" 14set _index_inner@3 _index_inner@3 + 1 15 jump 7 16 jump_if_not 20(20) _index_inner@3 = 2 17 stmt 0"SELECT 'start of IF/2/THEN block'" 18set _index_outer@1 _index_outer@1 + 1 19 jump 3 20 stmt 0"SELECT 'end of innerLoop'" 21set _index_inner@3 _index_inner@3 + 1 22 jump 7 23 stmt 0"SELECT 'end of outerLoop'" 24set _index_outer@1 _index_outer@1 + 1 25 jump 3
DROP PROCEDURE p1;
#
# End of 10.4 tests
#
#
# MDEV-19640 Wrong SHOW PROCEDURE output for SET GLOBAL sysvar1=expr, sysvar2=expr
#
CREATE ORREPLACE PROCEDURE p1()
BEGIN SET GLOBAL max_allowed_packet=16000000, max_error_count=60;
SELECT @@GLOBAL.max_allowed_packet, @@GLOBAL.max_error_count;
END;
$$
SHOW PROCEDURE CODE p1;
Pos Instruction 0 stmt 31"SET GLOBAL max_allowed_packet=16000000" 1 stmt 31"SET GLOBAL max_error_count=60" 2 stmt 0"SELECT @@GLOBAL.max_allowed_packet, @..."
DROP PROCEDURE p1;
#
# End of 10.5 tests
#
# Start of 11.8 tests
#
# MDEV-10862 Stored procedures: default values for parameters (optional parameters)
#
CREATE ORREPLACE PROCEDURE p1(par1 INT, par2 INT DEFAULT 1)
BEGIN
DECLARE var1 INT DEFAULT 5;
SELECT par1, par2 FROM DUAL;
END;
$$
SHOW PROCEDURE CODE p1;
Pos Instruction 0set default param par2@11 1set var1@25 2 stmt 0"SELECT par1, par2 FROM DUAL"
DROP PROCEDURE p1;
# End of 11.8 tests
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.82Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-10-08)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.