📄 sp-error.result
字号:
end case;return 2;end|select bug3287()|ERROR 20000: Case not found for CASE statementdrop function bug3287|create procedure bug3287(x int)case xwhen 0 theninsert into test.t1 values (x, 0.1);when 1 theninsert into test.t1 values (x, 1.1);end case|call bug3287(2)|ERROR 20000: Case not found for CASE statementdrop procedure bug3287|drop table if exists t3|create table t3 (s1 int, primary key (s1))|insert into t3 values (5),(6)|create procedure bug3279(out y int) begindeclare x int default 0;begindeclare exit handler for sqlexception set x = x+1;insert into t3 values (5);end;if x < 2 thenset x = x+1;insert into t3 values (6);end if;set y = x;end|set @x = 0|call bug3279(@x)|ERROR 23000: Duplicate entry '6' for key 1select @x|@x0drop procedure bug3279|drop table t3|create procedure nodb.bug3339() begin end|ERROR 42000: Unknown database 'nodb'create procedure bug2653_1(a int, out b int)set b = aa|create procedure bug2653_2(a int, out b int)beginif aa < 0 thenset b = - a;elseset b = a;end if;end|call bug2653_1(1, @b)|ERROR 42S22: Unknown column 'aa' in 'field list'call bug2653_2(2, @b)|ERROR 42S22: Unknown column 'aa' in 'field list'drop procedure bug2653_1|drop procedure bug2653_2|create procedure bug4344() drop procedure bug4344|ERROR HY000: Can't drop or alter a PROCEDURE from within another stored routinecreate procedure bug4344() drop function bug4344|ERROR HY000: Can't drop or alter a FUNCTION from within another stored routinedrop procedure if exists bug3294|create procedure bug3294()begindeclare continue handler for sqlexception drop table t5;drop table t5;drop table t5;end|create table t5 (x int)|call bug3294()|ERROR 42S02: Unknown table 't5'drop procedure bug3294|drop procedure if exists bug8776_1|drop procedure if exists bug8776_2|drop procedure if exists bug8776_3|drop procedure if exists bug8776_4|create procedure bug8776_1()begindeclare continue handler for sqlstate '42S0200test' begin end;begin end;end|ERROR 42000: Bad SQLSTATE: '42S0200test'create procedure bug8776_2()begindeclare continue handler for sqlstate '4200' begin end;begin end;end|ERROR 42000: Bad SQLSTATE: '4200'create procedure bug8776_3()begindeclare continue handler for sqlstate '420000' begin end;begin end;end|ERROR 42000: Bad SQLSTATE: '420000'create procedure bug8776_4()begindeclare continue handler for sqlstate '42x00' begin end;begin end;end|ERROR 42000: Bad SQLSTATE: '42x00'create procedure bug6600()check table t1|ERROR 0A000: CHECK is not allowed in stored procedurescreate procedure bug6600()lock table t1 read|ERROR 0A000: LOCK is not allowed in stored procedurescreate procedure bug6600()unlock table t1|ERROR 0A000: UNLOCK is not allowed in stored proceduresdrop procedure if exists bug9566|create procedure bug9566()beginselect * from t1;end|lock table t1 read|alter procedure bug9566 comment 'Some comment'|ERROR HY000: Table 'proc' was not locked with LOCK TABLESunlock tables|drop procedure bug9566|drop procedure if exists bug7299|create procedure bug7299()begindeclare v int;declare c cursor for select val from t1;declare exit handler for sqlexception select 'Error!'; open c;fetch c into v;end|delete from t1|call bug7299()|ERROR 02000: No data - zero rows fetched, selected, or processeddrop procedure bug7299|create procedure bug9073()begindeclare continue handler for sqlexception select 1;declare continue handler for sqlexception select 2;end|ERROR 42000: Duplicate handler declared in the same blockcreate procedure bug9073()begindeclare condname1 condition for 1234;declare continue handler for condname1 select 1;declare exit handler for condname1 select 2;end|ERROR 42000: Duplicate handler declared in the same blockcreate procedure bug9073()begindeclare condname1 condition for sqlstate '42000';declare condname2 condition for sqlstate '42000';declare exit handler for condname1 select 1;declare continue handler for condname2 select 2;end|ERROR 42000: Duplicate handler declared in the same blockcreate procedure bug9073()begindeclare condname1 condition for sqlstate '42000';declare exit handler for condname1 select 1;declare exit handler for sqlstate '42000' select 2;end|ERROR 42000: Duplicate handler declared in the same blockdrop procedure if exists bug9073|create procedure bug9073()begindeclare condname1 condition for sqlstate '42000';declare continue handler for condname1 select 1;begindeclare exit handler for sqlstate '42000' select 2;begindeclare continue handler for sqlstate '42000' select 3;end;end;end|drop procedure bug9073|create procedure bug7047()alter procedure bug7047|ERROR HY000: Can't drop or alter a PROCEDURE from within another stored routinecreate function bug7047() returns intbeginalter function bug7047;return 0;end|ERROR HY000: Can't drop or alter a FUNCTION from within another stored routinecreate function bug8408() returns intbeginselect * from t1;return 0;end|ERROR 0A000: Not allowed to return a result set from a functioncreate function bug8408() returns intbeginshow warnings;return 0;end|ERROR 0A000: Not allowed to return a result set from a functioncreate function bug8408(a int) returns intbegindeclare b int;select b;return b;end|ERROR 0A000: Not allowed to return a result set from a functiondrop function if exists bug8408_f|drop procedure if exists bug8408_p|create function bug8408_f() returns intbegincall bug8408_p();return 0;end|create procedure bug8408_p()select * from t1|call bug8408_p()|val xselect bug8408_f()|ERROR 0A000: Not allowed to return a result set from a functiondrop procedure bug8408_p|drop function bug8408_f|create function bug8408() returns intbegindeclare n int default 0;select count(*) into n from t1;return n;end|insert into t1 value (2, 2.7), (3, 3.14), (7, 7.0)|select *,bug8408() from t1|val x bug8408()2 2.7 33 3.14 37 7 3drop function bug8408|delete from t1|drop procedure if exists bug10537|create procedure bug10537()load data local infile '/tmp/somefile' into table t1|ERROR 0A000: LOAD DATA is not allowed in stored proceduresdrop function if exists bug8409|create function bug8409()returns intbeginflush tables;return 5;end|ERROR 0A000: FLUSH is not allowed in stored function or triggercreate procedure bug9529_901234567890123456789012345678901234567890123456789012345()beginend|ERROR 42000: Identifier name 'bug9529_901234567890123456789012345678901234567890123456789012345' is too longdrop procedure if exists bug17015_0123456789012345678901234567890123456789012345678901234|create procedure bug17015_0123456789012345678901234567890123456789012345678901234()beginend|show procedure status like 'bug17015%'|Db Name Type Definer Modified Created Security_type Commenttest bug17015_0123456789012345678901234567890123456789012345678901234 PROCEDURE root@localhost 0000-00-00 00:00:00 0000-00-00 00:00:00 DEFINER drop procedure bug17015_0123456789012345678901234567890123456789012345678901234|drop procedure if exists bug10969|create procedure bug10969()begindeclare s1 int default 0;select default(s1) from t30;end|ERROR 42000: Incorrect column name 's1'create procedure bug10969()begindeclare s1 int default 0;select default(t30.s1) from t30;end|drop procedure bug10969|drop table t1|create table t1(f1 int);create table t2(f1 int);CREATE PROCEDURE SP001()P1: BEGINDECLARE ENDTABLE INT DEFAULT 0;DECLARE TEMP_NUM INT;DECLARE TEMP_SUM INT;DECLARE C1 CURSOR FOR SELECT F1 FROM t1;DECLARE C2 CURSOR FOR SELECT F1 FROM t2;DECLARE CONTINUE HANDLER FOR NOT FOUND SET ENDTABLE = 1;SET ENDTABLE=0;SET TEMP_SUM=0;SET TEMP_NUM=0;OPEN C1;FETCH C1 INTO TEMP_NUM;WHILE ENDTABLE = 0 DOSET TEMP_SUM=TEMP_NUM+TEMP_SUM;FETCH C1 INTO TEMP_NUM;END WHILE;SELECT TEMP_SUM;CLOSE C1;CLOSE C1;SELECT 'end of proc';END P1|call SP001();TEMP_SUM0ERROR 24000: Cursor is not opendrop procedure SP001;drop table t1, t2;drop function if exists bug11394|drop function if exists bug11394_1|drop function if exists bug11394_2|drop procedure if exists bug11394|create function bug11394(i int) returns intbeginif i <= 0 thenreturn 0;elsereturn (i in (100, 200, bug11394(i-1), 400));end if;end|select bug11394(2)|ERROR HY000: Recursive stored functions and triggers are not allowed.drop function bug11394|create function bug11394_1(i int) returns intbeginif i <= 0 thenreturn 0;elsereturn (select bug11394_1(i-1));end if;end|select bug11394_1(2)|ERROR HY000: Recursive stored functions and triggers are not allowed.drop function bug11394_1|create function bug11394_2(i int) returns int return i|select bug11394_2(bug11394_2(10))|bug11394_2(bug11394_2(10))10drop function bug11394_2|create procedure bug11394(i int, j int)beginif i > 0 thencall bug11394(i - 1,(select 1));end if;end|call bug11394(2, 1)|ERROR HY000: Recursive limit 0 (as set by the max_sp_recursion_depth variable) was exceeded for routine bug11394set @@max_sp_recursion_depth=10|call bug11394(2, 1)|set @@max_sp_recursion_depth=default|drop procedure bug11394|CREATE PROCEDURE BUG_12490() HELP CONTENTS;ERROR 0A000: HELP is not allowed in stored proceduresCREATE FUNCTION BUG_12490() RETURNS INT HELP CONTENTS;ERROR 0A000: HELP is not allowed in stored proceduresCREATE TABLE t_bug_12490(a int);CREATE TRIGGER BUG_12490 BEFORE UPDATE ON t_bug_12490 FOR EACH ROW HELP CONTENTS;ERROR 0A000: HELP is not allowed in stored proceduresDROP TABLE t_bug_12490;drop function if exists bug11834_1;drop function if exists bug11834_2;create function bug11834_1() returns int return 10;create function bug11834_2() returns int return bug11834_1();prepare stmt from "select bug11834_2()";execute stmt;bug11834_2()10execute stmt;bug11834_2()10drop function bug11834_1;execute stmt;ERROR 42000: FUNCTION test.bug11834_1 does not existdeallocate prepare stmt;drop function bug11834_2;DROP FUNCTION IF EXISTS bug12953|CREATE FUNCTION bug12953() RETURNS INTBEGINOPTIMIZE TABLE t1;RETURN 1;END|ERROR 0A000: Not allowed to return a result set from a functionDROP FUNCTION IF EXISTS bug12995|CREATE FUNCTION bug12995() RETURNS INTBEGINHANDLER t1 OPEN;RETURN 1;END|ERROR 0A000: HANDLER is not allowed in stored proceduresCREATE FUNCTION bug12995() RETURNS INTBEGINHANDLER t1 READ FIRST;RETURN 1;END|ERROR 0A000: HANDLER is not allowed in stored proceduresCREATE FUNCTION bug12995() RETURNS INTBEGINHANDLER t1 CLOSE;RETURN 1;END|ERROR 0A000: HANDLER is not allowed in stored proceduresSELECT bug12995()|
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -