Commit f8b7968e authored by unknown's avatar unknown

Added another select into test.


mysql-test/r/sp.result:
  Added another test for select into (mixed variable types), and made into_test
  independent of previous tests.
mysql-test/t/sp.test:
  Added another test for select into (mixed variable types), and made into_test
  independent of previous tests.
parent 7b137f15
...@@ -137,14 +137,17 @@ insert into test.t1 values ("h1", x); ...@@ -137,14 +137,17 @@ insert into test.t1 values ("h1", x);
else else
insert into test.t1 values ("h?", x); insert into test.t1 values ("h?", x);
end case; end case;
create procedure into_test() create procedure into_test(x char(16), y int)
begin
insert into test.t1 values (x, y);
select id,data into x,y from test.t1 limit 1;
insert into test.t1 values (concat(x, "2"), y+2);
end;
create procedure into_test2(x char(16), y int)
begin begin
declare x char(16);
declare y int;
set x="aaaaa";
set y=22;
select id,data into x,y from test.t1 limit 2,1;
insert into test.t1 values (x, y); insert into test.t1 values (x, y);
select id,data into x,@z from test.t1 limit 1;
insert into test.t1 values (concat(x, "2"), y+2);
end; end;
call foo42(); call foo42();
select * from t1; select * from t1;
...@@ -258,13 +261,18 @@ id data ...@@ -258,13 +261,18 @@ id data
h0 0 h0 0
h1 1 h1 1
h? 17 h? 17
call into_test(); delete from t1;
call into_test("into", 100);
select * from t1; select * from t1;
id data id data
h0 0 into 100
h1 1 into2 102
h? 17 delete from t1;
h? 17 call into_test2("into", 100);
select id,data,@z from t1;
id data @z
into 100 100
into2 102 100
delete from t1; delete from t1;
drop procedure foo42; drop procedure foo42;
drop procedure bar; drop procedure bar;
...@@ -288,4 +296,5 @@ drop procedure f; ...@@ -288,4 +296,5 @@ drop procedure f;
drop procedure g; drop procedure g;
drop procedure h; drop procedure h;
drop procedure into_test; drop procedure into_test;
drop procedure into_test2;
drop table t1; drop table t1;
...@@ -205,14 +205,19 @@ else ...@@ -205,14 +205,19 @@ else
insert into test.t1 values ("h?", x); insert into test.t1 values ("h?", x);
end case| end case|
create procedure into_test() create procedure into_test(x char(16), y int)
begin
insert into test.t1 values (x, y);
select id,data into x,y from test.t1 limit 1;
insert into test.t1 values (concat(x, "2"), y+2);
end|
# Test INTO with a mix of local and global variables
create procedure into_test2(x char(16), y int)
begin begin
declare x char(16);
declare y int;
set x="aaaaa";
set y=22;
select id,data into x,y from test.t1 limit 2,1;
insert into test.t1 values (x, y); insert into test.t1 values (x, y);
select id,data into x,@z from test.t1 limit 1;
insert into test.t1 values (concat(x, "2"), y+2);
end| end|
delimiter ;| delimiter ;|
...@@ -291,10 +296,16 @@ call h(0); ...@@ -291,10 +296,16 @@ call h(0);
call h(1); call h(1);
call h(17); call h(17);
select * from t1; select * from t1;
call into_test(); delete from t1;
call into_test("into", 100);
select * from t1; select * from t1;
delete from t1; delete from t1;
call into_test2("into", 100);
select id,data,@z from t1;
delete from t1;
drop procedure foo42; drop procedure foo42;
drop procedure bar; drop procedure bar;
drop procedure two; drop procedure two;
...@@ -317,5 +328,6 @@ drop procedure f; ...@@ -317,5 +328,6 @@ drop procedure f;
drop procedure g; drop procedure g;
drop procedure h; drop procedure h;
drop procedure into_test; drop procedure into_test;
drop procedure into_test2;
drop table t1; drop table t1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment