diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc.result b/mysql-test/suite/funcs_1/r/innodb_storedproc.result index 3fd7020c114..04c1a45e67e 100644 --- a/mysql-test/suite/funcs_1/r/innodb_storedproc.result +++ b/mysql-test/suite/funcs_1/r/innodb_storedproc.result @@ -3635,13 +3635,9 @@ SELECT count(*) into cnt from t2; set @count = cnt; SELECT @count; END// -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 '; -set @count = cnt; -SELECT @count; -END' at line 2 +ERROR 42S22: Unknown column 'cnt' in 'field list' CALL sp1( 10 ); -ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist -DROP PROCEDURE IF EXISTS sp1; +DROP PROCEDURE sp1; CREATE PROCEDURE sp1( cnt int(20) ) END SELECT count(*) into cnt from t2; diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc.result b/mysql-test/suite/funcs_1/r/memory_storedproc.result index e05b08932a9..47e8ab24a01 100644 --- a/mysql-test/suite/funcs_1/r/memory_storedproc.result +++ b/mysql-test/suite/funcs_1/r/memory_storedproc.result @@ -3636,13 +3636,9 @@ SELECT count(*) into cnt from t2; set @count = cnt; SELECT @count; END// -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 '; -set @count = cnt; -SELECT @count; -END' at line 2 +ERROR 42S22: Unknown column 'cnt' in 'field list' CALL sp1( 10 ); -ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist -DROP PROCEDURE IF EXISTS sp1; +DROP PROCEDURE sp1; CREATE PROCEDURE sp1( cnt int(20) ) END SELECT count(*) into cnt from t2; diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc.result b/mysql-test/suite/funcs_1/r/myisam_storedproc.result index e05b08932a9..47e8ab24a01 100644 --- a/mysql-test/suite/funcs_1/r/myisam_storedproc.result +++ b/mysql-test/suite/funcs_1/r/myisam_storedproc.result @@ -3636,13 +3636,9 @@ SELECT count(*) into cnt from t2; set @count = cnt; SELECT @count; END// -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 '; -set @count = cnt; -SELECT @count; -END' at line 2 +ERROR 42S22: Unknown column 'cnt' in 'field list' CALL sp1( 10 ); -ERROR 42000: PROCEDURE db_storedproc.sp1 does not exist -DROP PROCEDURE IF EXISTS sp1; +DROP PROCEDURE sp1; CREATE PROCEDURE sp1( cnt int(20) ) END SELECT count(*) into cnt from t2; diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc index ca51f3c0432..b740cf38708 100644 --- a/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc +++ b/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc @@ -2862,8 +2862,20 @@ DROP PROCEDURE IF EXISTS sp1; --enable_warnings # missing BEGIN +# PLEASE NOTE: +# this test client has the MULTI_QUERY capability, +# so that the following request (starting at 'CREATE' and ending at the // +# delimiter) is interpreted as follows: +# 1) it's a multi query +# 2) the first query is a valid CREATE PROCEDURE statement, and the +# procedure consist of only one SELECT statement +# 3) the second query is a SET statement, which is broken since it's +# referencing an unknown column 'cnt' +# 4) the next query (SELECT @count) is not parsed or executed, since 3) +# failed + delimiter //; ---error ER_PARSE_ERROR +--error ER_BAD_FIELD_ERROR CREATE PROCEDURE sp1( cnt int(20) ) SELECT count(*) into cnt from t2; set @count = cnt; @@ -2871,11 +2883,10 @@ CREATE PROCEDURE sp1( cnt int(20) ) END// delimiter ;// ---error ER_SP_DOES_NOT_EXIST CALL sp1( 10 ); --disable_warnings -DROP PROCEDURE IF EXISTS sp1; +DROP PROCEDURE sp1; --enable_warnings # wrong order of BEGIN and END