Loading mysql-test/r/sp-error.result +22 −4 Original line number Diff line number Diff line Loading @@ -125,13 +125,13 @@ set @x = x| create function f(x int) returns int return x+42| call p()| ERROR 42000: Incorrect number of arguments for PROCEDURE p; expected 1, got 0 ERROR 42000: Incorrect number of arguments for PROCEDURE test.p; expected 1, got 0 call p(1, 2)| ERROR 42000: Incorrect number of arguments for PROCEDURE p; expected 1, got 2 ERROR 42000: Incorrect number of arguments for PROCEDURE test.p; expected 1, got 2 select f()| ERROR 42000: Incorrect number of arguments for FUNCTION f; expected 1, got 0 ERROR 42000: Incorrect number of arguments for FUNCTION test.f; expected 1, got 0 select f(1, 2)| ERROR 42000: Incorrect number of arguments for FUNCTION f; expected 1, got 2 ERROR 42000: Incorrect number of arguments for FUNCTION test.f; expected 1, got 2 drop procedure p| drop function f| create procedure p(val int, out res int) Loading Loading @@ -318,6 +318,24 @@ select field from t1; label L1; end| ERROR HY000: GOTO is not allowed in a stored procedure handler drop procedure if exists p| create procedure p(in x int, inout y int, out z int) begin set 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_z 42 45 87 call p(42, 43, @tmp_z)| ERROR 42000: OUT or INOUT argument 2 for routine test.p is not a variable call p(42, @tmp_y, 43)| ERROR 42000: OUT or INOUT argument 3 for routine test.p is not a variable drop procedure p| create procedure bug1965() begin declare c cursor for select val from t1 order by valname; Loading mysql-test/r/sp.result +28 −0 Original line number Diff line number Diff line Loading @@ -2908,4 +2908,32 @@ v/10 10.00000 drop procedure bug9674_1| drop procedure bug9674_2| drop procedure if exists bug9598_1| drop procedure if exists bug9598_2| create procedure bug9598_1(in var_1 char(16), out var_2 integer, out var_3 integer) begin set var_2 = 50; set var_3 = 60; end| create procedure bug9598_2(in v1 char(16), in v2 integer, in v3 integer, in v4 integer, in v5 integer) begin select v1,v2,v3,v4,v5; call bug9598_1(v1,@tmp1,@tmp2); select v1,v2,v3,v4,v5; end| call bug9598_2('Test',2,3,4,5)| v1 v2 v3 v4 v5 Test 2 3 4 5 v1 v2 v3 v4 v5 Test 2 3 4 5 select @tmp1, @tmp2| @tmp1 @tmp2 50 60 drop procedure bug9598_1| drop procedure bug9598_2| drop table t1,t2; mysql-test/t/sp-error.test +25 −0 Original line number Diff line number Diff line Loading @@ -410,6 +410,31 @@ begin label L1; end| # Check in and inout arguments. --disable_warnings drop procedure if exists p| --enable_warnings create procedure p(in x int, inout y int, out z int) begin set y = x+y; set z = x+y; end| set @tmp_x = 42| set @tmp_y = 3| set @tmp_z = 0| # For reference: this is ok call p(@tmp_x, @tmp_y, @tmp_z)| select @tmp_x, @tmp_y, @tmp_z| --error ER_SP_NOT_VAR_ARG call p(42, 43, @tmp_z)| --error ER_SP_NOT_VAR_ARG call p(42, @tmp_y, 43)| drop procedure p| # # BUG#1965 # Loading mysql-test/t/sp.test +32 −0 Original line number Diff line number Diff line Loading @@ -3571,6 +3571,38 @@ drop procedure bug9674_1| drop procedure bug9674_2| # # BUG#9598: stored procedure call within stored procedure overwrites IN variable # --disable_warnings drop procedure if exists bug9598_1| drop procedure if exists bug9598_2| --enable_warnings create procedure bug9598_1(in var_1 char(16), out var_2 integer, out var_3 integer) begin set var_2 = 50; set var_3 = 60; end| create procedure bug9598_2(in v1 char(16), in v2 integer, in v3 integer, in v4 integer, in v5 integer) begin select v1,v2,v3,v4,v5; call bug9598_1(v1,@tmp1,@tmp2); select v1,v2,v3,v4,v5; end| call bug9598_2('Test',2,3,4,5)| select @tmp1, @tmp2| drop procedure bug9598_1| drop procedure bug9598_2| # # BUG#NNNN: New bug synopsis # Loading sql/item.h +4 −0 Original line number Diff line number Diff line Loading @@ -545,6 +545,8 @@ class Item { cleanup(); delete this; } virtual bool is_splocal() { return 0; } /* Needed for error checking */ }; Loading @@ -564,6 +566,8 @@ class Item_splocal : public Item Item::maybe_null= TRUE; } bool is_splocal() { return 1; } /* Needed for error checking */ Item *this_item(); Item *this_const_item() const; Loading Loading
mysql-test/r/sp-error.result +22 −4 Original line number Diff line number Diff line Loading @@ -125,13 +125,13 @@ set @x = x| create function f(x int) returns int return x+42| call p()| ERROR 42000: Incorrect number of arguments for PROCEDURE p; expected 1, got 0 ERROR 42000: Incorrect number of arguments for PROCEDURE test.p; expected 1, got 0 call p(1, 2)| ERROR 42000: Incorrect number of arguments for PROCEDURE p; expected 1, got 2 ERROR 42000: Incorrect number of arguments for PROCEDURE test.p; expected 1, got 2 select f()| ERROR 42000: Incorrect number of arguments for FUNCTION f; expected 1, got 0 ERROR 42000: Incorrect number of arguments for FUNCTION test.f; expected 1, got 0 select f(1, 2)| ERROR 42000: Incorrect number of arguments for FUNCTION f; expected 1, got 2 ERROR 42000: Incorrect number of arguments for FUNCTION test.f; expected 1, got 2 drop procedure p| drop function f| create procedure p(val int, out res int) Loading Loading @@ -318,6 +318,24 @@ select field from t1; label L1; end| ERROR HY000: GOTO is not allowed in a stored procedure handler drop procedure if exists p| create procedure p(in x int, inout y int, out z int) begin set 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_z 42 45 87 call p(42, 43, @tmp_z)| ERROR 42000: OUT or INOUT argument 2 for routine test.p is not a variable call p(42, @tmp_y, 43)| ERROR 42000: OUT or INOUT argument 3 for routine test.p is not a variable drop procedure p| create procedure bug1965() begin declare c cursor for select val from t1 order by valname; Loading
mysql-test/r/sp.result +28 −0 Original line number Diff line number Diff line Loading @@ -2908,4 +2908,32 @@ v/10 10.00000 drop procedure bug9674_1| drop procedure bug9674_2| drop procedure if exists bug9598_1| drop procedure if exists bug9598_2| create procedure bug9598_1(in var_1 char(16), out var_2 integer, out var_3 integer) begin set var_2 = 50; set var_3 = 60; end| create procedure bug9598_2(in v1 char(16), in v2 integer, in v3 integer, in v4 integer, in v5 integer) begin select v1,v2,v3,v4,v5; call bug9598_1(v1,@tmp1,@tmp2); select v1,v2,v3,v4,v5; end| call bug9598_2('Test',2,3,4,5)| v1 v2 v3 v4 v5 Test 2 3 4 5 v1 v2 v3 v4 v5 Test 2 3 4 5 select @tmp1, @tmp2| @tmp1 @tmp2 50 60 drop procedure bug9598_1| drop procedure bug9598_2| drop table t1,t2;
mysql-test/t/sp-error.test +25 −0 Original line number Diff line number Diff line Loading @@ -410,6 +410,31 @@ begin label L1; end| # Check in and inout arguments. --disable_warnings drop procedure if exists p| --enable_warnings create procedure p(in x int, inout y int, out z int) begin set y = x+y; set z = x+y; end| set @tmp_x = 42| set @tmp_y = 3| set @tmp_z = 0| # For reference: this is ok call p(@tmp_x, @tmp_y, @tmp_z)| select @tmp_x, @tmp_y, @tmp_z| --error ER_SP_NOT_VAR_ARG call p(42, 43, @tmp_z)| --error ER_SP_NOT_VAR_ARG call p(42, @tmp_y, 43)| drop procedure p| # # BUG#1965 # Loading
mysql-test/t/sp.test +32 −0 Original line number Diff line number Diff line Loading @@ -3571,6 +3571,38 @@ drop procedure bug9674_1| drop procedure bug9674_2| # # BUG#9598: stored procedure call within stored procedure overwrites IN variable # --disable_warnings drop procedure if exists bug9598_1| drop procedure if exists bug9598_2| --enable_warnings create procedure bug9598_1(in var_1 char(16), out var_2 integer, out var_3 integer) begin set var_2 = 50; set var_3 = 60; end| create procedure bug9598_2(in v1 char(16), in v2 integer, in v3 integer, in v4 integer, in v5 integer) begin select v1,v2,v3,v4,v5; call bug9598_1(v1,@tmp1,@tmp2); select v1,v2,v3,v4,v5; end| call bug9598_2('Test',2,3,4,5)| select @tmp1, @tmp2| drop procedure bug9598_1| drop procedure bug9598_2| # # BUG#NNNN: New bug synopsis # Loading
sql/item.h +4 −0 Original line number Diff line number Diff line Loading @@ -545,6 +545,8 @@ class Item { cleanup(); delete this; } virtual bool is_splocal() { return 0; } /* Needed for error checking */ }; Loading @@ -564,6 +566,8 @@ class Item_splocal : public Item Item::maybe_null= TRUE; } bool is_splocal() { return 1; } /* Needed for error checking */ Item *this_item(); Item *this_const_item() const; Loading