Commit 9c22fc4b authored by unknown's avatar unknown

fix test for a bug to use correct tables


mysql-test/r/sp.result:
  fix result
mysql-test/t/sp.test:
  fix test for a bug: tests in sp.test should reuse tables t1 and t2 and create/drop tables t3, t4 etc.
  So, tables t1 and t2 were renamed into t3 and t4
parent 5610365b
...@@ -3101,16 +3101,16 @@ call p_bug11247(10)| ...@@ -3101,16 +3101,16 @@ call p_bug11247(10)|
drop function f_bug11247| drop function f_bug11247|
drop procedure p_bug11247| drop procedure p_bug11247|
drop procedure if exists bug12168| drop procedure if exists bug12168|
drop table if exists t1, t2| drop table if exists t3, t4|
create table t1 (a int)| create table t3 (a int)|
insert into t1 values (1),(2),(3),(4)| insert into t3 values (1),(2),(3),(4)|
create table t2 (a int)| create table t4 (a int)|
create procedure bug12168(arg1 char(1)) create procedure bug12168(arg1 char(1))
begin begin
declare b, c integer; declare b, c integer;
if arg1 = 'a' then if arg1 = 'a' then
begin begin
declare c1 cursor for select a from t1 where a % 2; declare c1 cursor for select a from t3 where a % 2;
declare continue handler for not found set b = 1; declare continue handler for not found set b = 1;
set b = 0; set b = 0;
open c1; open c1;
...@@ -3119,14 +3119,14 @@ fetch c1 into c; ...@@ -3119,14 +3119,14 @@ fetch c1 into c;
if (b = 1) then if (b = 1) then
leave c1_repeat; leave c1_repeat;
end if; end if;
insert into t2 values (c); insert into t4 values (c);
until b = 1 until b = 1
end repeat; end repeat;
end; end;
end if; end if;
if arg1 = 'b' then if arg1 = 'b' then
begin begin
declare c2 cursor for select a from t1 where not a % 2; declare c2 cursor for select a from t3 where not a % 2;
declare continue handler for not found set b = 1; declare continue handler for not found set b = 1;
set b = 0; set b = 0;
open c2; open c2;
...@@ -3135,35 +3135,36 @@ fetch c2 into c; ...@@ -3135,35 +3135,36 @@ fetch c2 into c;
if (b = 1) then if (b = 1) then
leave c2_repeat; leave c2_repeat;
end if; end if;
insert into t2 values (c); insert into t4 values (c);
until b = 1 until b = 1
end repeat; end repeat;
end; end;
end if; end if;
end| end|
call bug12168('a')| call bug12168('a')|
select * from t2| select * from t4|
a a
1 1
3 3
truncate t2| truncate t4|
call bug12168('b')| call bug12168('b')|
select * from t2| select * from t4|
a a
2 2
4 4
truncate t2| truncate t4|
call bug12168('a')| call bug12168('a')|
select * from t2| select * from t4|
a a
1 1
3 3
truncate t2| truncate t4|
call bug12168('b')| call bug12168('b')|
select * from t2| select * from t4|
a a
2 2
4 4
truncate t2| truncate t4|
drop table t3, t4|
drop procedure if exists bug12168| drop procedure if exists bug12168|
drop table t1,t2; drop table t1,t2;
...@@ -3934,20 +3934,20 @@ drop procedure p_bug11247| ...@@ -3934,20 +3934,20 @@ drop procedure p_bug11247|
# #
--disable_warnings --disable_warnings
drop procedure if exists bug12168| drop procedure if exists bug12168|
drop table if exists t1, t2| drop table if exists t3, t4|
--enable_warnings --enable_warnings
create table t1 (a int)| create table t3 (a int)|
insert into t1 values (1),(2),(3),(4)| insert into t3 values (1),(2),(3),(4)|
create table t2 (a int)| create table t4 (a int)|
create procedure bug12168(arg1 char(1)) create procedure bug12168(arg1 char(1))
begin begin
declare b, c integer; declare b, c integer;
if arg1 = 'a' then if arg1 = 'a' then
begin begin
declare c1 cursor for select a from t1 where a % 2; declare c1 cursor for select a from t3 where a % 2;
declare continue handler for not found set b = 1; declare continue handler for not found set b = 1;
set b = 0; set b = 0;
open c1; open c1;
...@@ -3957,14 +3957,14 @@ begin ...@@ -3957,14 +3957,14 @@ begin
leave c1_repeat; leave c1_repeat;
end if; end if;
insert into t2 values (c); insert into t4 values (c);
until b = 1 until b = 1
end repeat; end repeat;
end; end;
end if; end if;
if arg1 = 'b' then if arg1 = 'b' then
begin begin
declare c2 cursor for select a from t1 where not a % 2; declare c2 cursor for select a from t3 where not a % 2;
declare continue handler for not found set b = 1; declare continue handler for not found set b = 1;
set b = 0; set b = 0;
open c2; open c2;
...@@ -3974,7 +3974,7 @@ begin ...@@ -3974,7 +3974,7 @@ begin
leave c2_repeat; leave c2_repeat;
end if; end if;
insert into t2 values (c); insert into t4 values (c);
until b = 1 until b = 1
end repeat; end repeat;
end; end;
...@@ -3982,17 +3982,18 @@ begin ...@@ -3982,17 +3982,18 @@ begin
end| end|
call bug12168('a')| call bug12168('a')|
select * from t2| select * from t4|
truncate t2| truncate t4|
call bug12168('b')| call bug12168('b')|
select * from t2| select * from t4|
truncate t2| truncate t4|
call bug12168('a')| call bug12168('a')|
select * from t2| select * from t4|
truncate t2| truncate t4|
call bug12168('b')| call bug12168('b')|
select * from t2| select * from t4|
truncate t2| truncate t4|
drop table t3, t4|
drop procedure if exists bug12168| drop procedure if exists bug12168|
# #
......
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