summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/sp-error.result13
-rw-r--r--mysql-test/t/sp-error.test31
2 files changed, 44 insertions, 0 deletions
diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result
index fb544ccd8de..2766dca5845 100644
--- a/mysql-test/r/sp-error.result
+++ b/mysql-test/r/sp-error.result
@@ -1163,3 +1163,16 @@ return 1;
end|
ERROR 0A000: Not allowed to return a result set from a function
drop table t1;
+drop procedure if exists bug15091;
+create procedure bug15091()
+begin
+declare selectstr varchar(6000) default ' ';
+declare conditionstr varchar(5000) default '';
+set selectstr = concat(selectstr,
+' and ',
+c.operatorid,
+'in (',conditionstr, ')');
+end|
+call bug15091();
+ERROR 42S02: Unknown table 'c' in field list
+drop procedure bug15091;
diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test
index 22cc325f55e..e1839b4b98f 100644
--- a/mysql-test/t/sp-error.test
+++ b/mysql-test/t/sp-error.test
@@ -1673,6 +1673,37 @@ drop table t1;
#
+# BUG#15091: Sp Returns Unknown error in order clause....and
+# there is no order by clause
+#
+--disable_warnings
+drop procedure if exists bug15091;
+--enable_warnings
+
+delimiter |;
+create procedure bug15091()
+begin
+ declare selectstr varchar(6000) default ' ';
+ declare conditionstr varchar(5000) default '';
+
+ set selectstr = concat(selectstr,
+ ' and ',
+ c.operatorid,
+ 'in (',conditionstr, ')');
+end|
+delimiter ;|
+
+# The error message used to be:
+# ERROR 1109 (42S02): Unknown table 'c' in order clause
+# but is now rephrased to something less misleading:
+# ERROR 1109 (42S02): Unknown table 'c' in field list
+--error ER_UNKNOWN_TABLE
+call bug15091();
+
+drop procedure bug15091;
+
+
+#
# BUG#NNNN: New bug synopsis
#
#--disable_warnings