Commit aaa54ac7 authored by unknown's avatar unknown

Fixed BUG#4905: Stored procedure doesn't clear for "Rows affected".


mysql-test/r/sp.result:
  New test case for BUG#4905
mysql-test/t/sp.test:
  New test case for BUG#4905
sql/sql_parse.cc:
  Reset row count before CALL.
parent f61034d7
...@@ -1894,6 +1894,32 @@ flush status| ...@@ -1894,6 +1894,32 @@ flush status|
flush query cache| flush query cache|
delete from t1| delete from t1|
drop procedure bug3583| drop procedure bug3583|
drop table if exists t3|
drop procedure if exists bug4905|
create table t3 (s1 int,primary key (s1))|
create procedure bug4905()
begin
declare v int;
declare continue handler for sqlstate '23000' set v = 5;
insert into t3 values (1);
end|
call bug4905()|
select row_count()|
row_count()
1
call bug4905()|
select row_count()|
row_count()
0
call bug4905()|
select row_count()|
row_count()
0
select * from t3|
s1
1
drop procedure bug4905|
drop table t3|
drop table if exists fac| drop table if exists fac|
create table fac (n int unsigned not null primary key, f bigint unsigned)| create table fac (n int unsigned not null primary key, f bigint unsigned)|
create procedure ifac(n int unsigned) create procedure ifac(n int unsigned)
......
...@@ -2056,6 +2056,35 @@ flush query cache| ...@@ -2056,6 +2056,35 @@ flush query cache|
delete from t1| delete from t1|
drop procedure bug3583| drop procedure bug3583|
#
# BUG#4905: Stored procedure doesn't clear for "Rows affected"
#
--disable_warnings
drop table if exists t3|
drop procedure if exists bug4905|
--enable_warnings
create table t3 (s1 int,primary key (s1))|
create procedure bug4905()
begin
declare v int;
declare continue handler for sqlstate '23000' set v = 5;
insert into t3 values (1);
end|
call bug4905()|
select row_count()|
call bug4905()|
select row_count()|
call bug4905()|
select row_count()|
select * from t3|
drop procedure bug4905|
drop table t3|
# #
# Some "real" examples # Some "real" examples
......
...@@ -3724,6 +3724,7 @@ purposes internal to the MySQL server", MYF(0)); ...@@ -3724,6 +3724,7 @@ purposes internal to the MySQL server", MYF(0));
select_limit= thd->variables.select_limit; select_limit= thd->variables.select_limit;
thd->variables.select_limit= HA_POS_ERROR; thd->variables.select_limit= HA_POS_ERROR;
thd->row_count_func= 0;
res= sp->execute_procedure(thd, &lex->value_list); res= sp->execute_procedure(thd, &lex->value_list);
thd->variables.select_limit= select_limit; thd->variables.select_limit= select_limit;
......
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