summaryrefslogtreecommitdiff
path: root/mysql-test/r/sp-error.result
diff options
context:
space:
mode:
authorunknown <anozdrin@mysql.com>2005-10-25 13:02:48 +0400
committerunknown <anozdrin@mysql.com>2005-10-25 13:02:48 +0400
commit5ed3b0b3d7d3474823b9d07844b74620d6b6b065 (patch)
treec016532cef6719e53b426f6b3d9f5a4ebcd8c0ba /mysql-test/r/sp-error.result
parent215602cbe39243e9b6421894e11aa52ef576da81 (diff)
downloadmariadb-git-5ed3b0b3d7d3474823b9d07844b74620d6b6b065.tar.gz
Fix for BUG#13037: undefined variable in IF cause erroneous error-message.
mysql-test/r/sp-error.result: Results for the test case for BUG#13037. mysql-test/t/sp-error.test: Test case for BUG#13037. sql/sql_base.cc: Polishing: use constant. sql/sql_class.cc: Reset THD::where in THD::cleanup_after_query(); Polishing: use the constant (THD::DEFAULT_WHERE). sql/sql_class.h: Introduce a constant for the default value of THD::where.
Diffstat (limited to 'mysql-test/r/sp-error.result')
-rw-r--r--mysql-test/r/sp-error.result37
1 files changed, 35 insertions, 2 deletions
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index 7ee2d168ddd..50ff7ea264a 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -444,9 +444,9 @@ set b = a;
end if;
end|
call bug2653_1(1, @b)|
-ERROR 42S22: Unknown column 'aa' in 'order clause'
+ERROR 42S22: Unknown column 'aa' in 'field list'
call bug2653_2(2, @b)|
-ERROR 42S22: Unknown column 'aa' in 'order clause'
+ERROR 42S22: Unknown column 'aa' in 'field list'
drop procedure bug2653_1|
drop procedure bug2653_2|
create procedure bug4344() drop procedure bug4344|
@@ -883,3 +883,36 @@ select count(*) into param1 from t3;
end|
ERROR 3D000: No database selected
use test;
+DROP PROCEDURE IF EXISTS bug13037_p1;
+DROP PROCEDURE IF EXISTS bug13037_p2;
+DROP PROCEDURE IF EXISTS bug13037_p3;
+CREATE PROCEDURE bug13037_p1()
+BEGIN
+IF bug13037_foo THEN
+SELECT 1;
+END IF;
+END|
+CREATE PROCEDURE bug13037_p2()
+BEGIN
+SET @bug13037_foo = bug13037_bar;
+END|
+CREATE PROCEDURE bug13037_p3()
+BEGIN
+SELECT bug13037_foo;
+END|
+
+CALL bug13037_p1();
+ERROR 42S22: Unknown column 'bug13037_foo' in 'field list'
+CALL bug13037_p2();
+ERROR 42S22: Unknown column 'bug13037_bar' in 'field list'
+CALL bug13037_p3();
+ERROR 42S22: Unknown column 'bug13037_foo' in 'field list'
+CALL bug13037_p1();
+ERROR 42S22: Unknown column 'bug13037_foo' in 'field list'
+CALL bug13037_p2();
+ERROR 42S22: Unknown column 'bug13037_bar' in 'field list'
+CALL bug13037_p3();
+ERROR 42S22: Unknown column 'bug13037_foo' in 'field list'
+DROP PROCEDURE bug13037_p1;
+DROP PROCEDURE bug13037_p2;
+DROP PROCEDURE bug13037_p3;