summaryrefslogtreecommitdiff
path: root/mysql-test/r/sp-error.result
diff options
context:
space:
mode:
authorunknown <sergefp@mysql.com>2005-07-04 23:00:23 +0000
committerunknown <sergefp@mysql.com>2005-07-04 23:00:23 +0000
commit76990cea070e7ac979c9f94b0db71bac83147ea7 (patch)
tree37c95f642beb357948fb19974de6dcf0b8499ec8 /mysql-test/r/sp-error.result
parent90949a318cb47a211245fac1ec6df6b7479d2b9c (diff)
downloadmariadb-git-76990cea070e7ac979c9f94b0db71bac83147ea7.tar.gz
Fix for BUG#9814: Clear thd->net.no_send_error before each SP instruction
execution. Failure to do so caused the erroneous statements to send nothing and hang the client. mysql-test/r/sp-error.result: Testcase for BUG#9814. Note that the result demonstrates that currently mysql-test-run ignores errors in multi-statement if they arrive after first resultset has been received. mysql-test/t/sp-error.test: Testcase for BUG#09814.
Diffstat (limited to 'mysql-test/r/sp-error.result')
-rw-r--r--mysql-test/r/sp-error.result30
1 files changed, 30 insertions, 0 deletions
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index bfbfb87ac43..171978fdb06 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -1,3 +1,4 @@
+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 1
@@ -635,3 +636,32 @@ ERROR 0A000: EXECUTE is not allowed in stored procedures
create function f() returns int begin execute stmt;
ERROR 0A000: EXECUTE is not allowed in stored procedures
deallocate prepare stmt;
+create table t1(f1 int);
+create table t2(f1 int);
+CREATE PROCEDURE SP001()
+P1: BEGIN
+DECLARE ENDTABLE INT DEFAULT 0;
+DECLARE TEMP_NUM INT;
+DECLARE TEMP_SUM INT;
+DECLARE C1 CURSOR FOR SELECT F1 FROM t1;
+DECLARE C2 CURSOR FOR SELECT F1 FROM t2;
+DECLARE CONTINUE HANDLER FOR NOT FOUND SET ENDTABLE = 1;
+SET ENDTABLE=0;
+SET TEMP_SUM=0;
+SET TEMP_NUM=0;
+OPEN C1;
+FETCH C1 INTO TEMP_NUM;
+WHILE ENDTABLE = 0 DO
+SET TEMP_SUM=TEMP_NUM+TEMP_SUM;
+FETCH C1 INTO TEMP_NUM;
+END WHILE;
+SELECT TEMP_SUM;
+CLOSE C1;
+CLOSE C1;
+SELECT 'end of proc';
+END P1|
+call SP001();
+TEMP_SUM
+0
+drop procedure SP001;
+drop table t1, t2;