📄 sp-error.result
字号:
drop table if exists t1, t2;delete from mysql.proc;create procedure syntaxerror(t int)|ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1create procedure syntaxerror(t int)|ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1create procedure syntaxerror(t int)|ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1drop table if exists t3|create table t3 ( x int )|insert into t3 values (2), (3)|create procedure bad_into(out param int)select x from t3 into param|call bad_into(@x)|ERROR 42000: Result consisted of more than one rowdrop procedure bad_into|drop table t3|create procedure proc1()set @x = 42|create function func1() returns intreturn 42|create procedure foo()create procedure bar() set @x=3|ERROR 2F003: Can't create a PROCEDURE from within another stored routinecreate procedure foo()create function bar() returns double return 2.3|ERROR 2F003: Can't create a FUNCTION from within another stored routinecreate procedure proc1()set @x = 42|ERROR 42000: PROCEDURE proc1 already existscreate function func1() returns intreturn 42|ERROR 42000: FUNCTION func1 already existsdrop procedure proc1|drop function func1|alter procedure foo|ERROR 42000: PROCEDURE test.foo does not existalter function foo|ERROR 42000: FUNCTION test.foo does not existdrop procedure foo|ERROR 42000: PROCEDURE test.foo does not existdrop function foo|ERROR 42000: FUNCTION test.foo does not existcall foo()|ERROR 42000: PROCEDURE test.foo does not existdrop procedure if exists foo|Warnings:Note 1305 PROCEDURE foo does not existshow create procedure foo|ERROR 42000: PROCEDURE foo does not existshow create function foo|ERROR 42000: FUNCTION foo does not existcreate procedure foo()foo: loopleave bar;end loop|ERROR 42000: LEAVE with no matching label: barcreate procedure foo()foo: loopiterate bar;end loop|ERROR 42000: ITERATE with no matching label: barcreate procedure foo()foo: beginiterate foo;end|ERROR 42000: ITERATE with no matching label: foocreate procedure foo()foo: loopfoo: loopset @x=2;end loop foo;end loop foo|ERROR 42000: Redefining label foocreate procedure foo()foo: loopset @x=2;end loop bar|ERROR 42000: End-label bar without matchcreate procedure foo()return 42|ERROR 42000: RETURN is only allowed in a FUNCTIONcreate procedure p(x int)set @x = x|create function f(x int) returns intreturn x+42|call p()|ERROR 42000: Incorrect number of arguments for PROCEDURE test.p; expected 1, got 0call p(1, 2)|ERROR 42000: Incorrect number of arguments for PROCEDURE test.p; expected 1, got 2select f()|ERROR 42000: Incorrect number of arguments for FUNCTION test.f; expected 1, got 0select f(1, 2)|ERROR 42000: Incorrect number of arguments for FUNCTION test.f; expected 1, got 2drop procedure p|drop function f|create procedure p(val int, out res int)begindeclare x int default 0;declare continue handler for foo set x = 1;insert into test.t1 values (val);if (x) thenset res = 0;elseset res = 1;end if;end|ERROR 42000: Undefined CONDITION: foocreate procedure p(val int, out res int)begindeclare x int default 0;declare foo condition for 1146;declare continue handler for bar set x = 1;insert into test.t1 values (val);if (x) thenset res = 0;elseset res = 1;end if;end|ERROR 42000: Undefined CONDITION: barcreate function f(val int) returns intbegindeclare x int;set x = val+3;end|ERROR 42000: No RETURN found in FUNCTION test.fcreate function f(val int) returns intbegindeclare x int;set x = val+3;if x < 4 thenreturn x;end if;end|select f(10)|ERROR 2F005: FUNCTION f ended without RETURNdrop function f|create procedure p()begindeclare c cursor for insert into test.t1 values ("foo", 42);open c;close c;end|ERROR 42000: Cursor statement must be a SELECTcreate procedure p()begindeclare x int;declare c cursor for select * into x from test.t limit 1;open c;close c;end|ERROR 42000: Cursor SELECT must not have INTOcreate procedure p()begindeclare c cursor for select * from test.t;open cc;close c;end|ERROR 42000: Undefined CURSOR: ccdrop table if exists t1|create table t1 (val int)|create procedure p()begindeclare c cursor for select * from test.t1;open c;open c;close c;end|call p()|ERROR 24000: Cursor is already opendrop procedure p|create procedure p()begindeclare c cursor for select * from test.t1;open c;close c;close c;end|call p()|ERROR 24000: Cursor is not opendrop procedure p|alter procedure bar3 sql security invoker|ERROR 42000: PROCEDURE test.bar3 does not existdrop table t1|drop table if exists t1|create table t1 (val int, x float)|insert into t1 values (42, 3.1), (19, 1.2)|create procedure p()begindeclare x int;declare c cursor for select * from t1;open c;fetch c into x, y;close c;end|ERROR 42000: Undeclared variable: ycreate procedure p()begindeclare x int;declare c cursor for select * from t1;open c;fetch c into x;close c;end|call p()|ERROR HY000: Incorrect number of FETCH variablesdrop procedure p|create procedure p()begindeclare x int;declare y float;declare z int;declare c cursor for select * from t1;open c;fetch c into x, y, z;close c;end|call p()|ERROR HY000: Incorrect number of FETCH variablesdrop procedure p|create procedure p(in x int, x char(10))beginend|ERROR 42000: Duplicate parameter: xcreate function p(x int, x char(10))beginend|ERROR 42000: Duplicate parameter: xcreate procedure p()begindeclare x float;declare x int;end|ERROR 42000: Duplicate variable: xcreate procedure p()begindeclare c condition for 1064;declare c condition for 1065;end|ERROR 42000: Duplicate condition: ccreate procedure p()begindeclare c cursor for select * from t1;declare c cursor for select field from t1;end|ERROR 42000: Duplicate cursor: ccreate procedure u()use sptmp|ERROR 0A000: USE is not allowed in stored procedurescreate procedure p()begindeclare c cursor for select * from t1;declare x int;end|ERROR 42000: Variable or condition declaration after cursor or handler declarationcreate procedure p()begindeclare x int;declare continue handler for sqlstate '42S99' set x = 1;declare foo condition for sqlstate '42S99';end|ERROR 42000: Variable or condition declaration after cursor or handler declarationcreate procedure p()begindeclare x int;declare continue handler for sqlstate '42S99' set x = 1;declare c cursor for select * from t1;end|ERROR 42000: Cursor declaration after handler declarationdrop procedure if exists p|create procedure p(in x int, inout y int, out z int)beginset y = x+y;set z = x+y;end|set @tmp_x = 42|set @tmp_y = 3|set @tmp_z = 0|call p(@tmp_x, @tmp_y, @tmp_z)|select @tmp_x, @tmp_y, @tmp_z|@tmp_x @tmp_y @tmp_z42 45 87call p(42, 43, @tmp_z)|ERROR 42000: OUT or INOUT argument 2 for routine test.p is not a variablecall p(42, @tmp_y, 43)|ERROR 42000: OUT or INOUT argument 3 for routine test.p is not a variabledrop procedure p|create procedure p() begin end|lock table t1 read|call p()|unlock tables|drop procedure p|lock tables t1 read, mysql.proc write|ERROR HY000: You can't combine write-locking of system 'mysql.proc' table with other tableslock tables mysql.proc write, mysql.user write|ERROR HY000: You can't combine write-locking of system 'mysql.proc' table with other tableslock tables t1 read, mysql.proc read|unlock tables|lock tables mysql.proc write|unlock tables|drop function if exists f1|create function f1(i int) returns intbegininsert into t1 (val) values (i);return 0;end|select val, f1(val) from t1|ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.select val, f1(val) from t1 as tab|ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.select * from t1|val x42 3.119 1.2update t1 set val= f1(val)|ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.select * from t1|val x42 3.119 1.2select f1(17)|f1(17)0select * from t1|val x42 3.119 1.217 NULLdelete from t1 where val= 17|drop function f1|create procedure bug1965()begindeclare c cursor for select val from t1 order by valname;open c;close c;end|call bug1965()|ERROR 42S22: Unknown column 'valname' in 'order clause'drop procedure bug1965|select 1 into a|ERROR 42000: Undeclared variable: adrop table if exists t3|create table t3 (column_1_0 int)|create procedure bug1653()update t3 set column_1 = 0|call bug1653()|ERROR 42S22: Unknown column 'column_1' in 'field list'drop table t3|create table t3 (column_1 int)|call bug1653()|drop procedure bug1653|drop table t3|create procedure bug2259()begindeclare v1 int;declare c1 cursor for select s1 from t1;fetch c1 into v1;end|call bug2259()|ERROR 24000: Cursor is not opendrop procedure bug2259|create procedure bug2272()begindeclare v int;update t1 set v = 42;end|insert into t1 values (666, 51.3)|call bug2272()|ERROR 42S22: Unknown column 'v' in 'field list'delete from t1|drop procedure bug2272|create procedure bug2329_1()begindeclare v int;insert into t1 (v) values (5);end|create procedure bug2329_2()begindeclare v int;replace t1 set v = 5;end|call bug2329_1()|ERROR 42S22: Unknown column 'v' in 'field list'call bug2329_2()|ERROR 42S22: Unknown column 'v' in 'field list'drop procedure bug2329_1|drop procedure bug2329_2|create function bug3287() returns intbegindeclare v int default null;casewhen v is not null then return 1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -