summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <pem@mysql.comhem.se>2004-03-17 12:09:03 +0100
committerunknown <pem@mysql.comhem.se>2004-03-17 12:09:03 +0100
commit36dd97239a7b3e84badb7fdc79b221c20cbfe38f (patch)
treec789edeeadcae70a23117ca6cb30daf503df4347 /mysql-test
parent857b59578c61a15b842f30c1a9b1e0fad8c868a3 (diff)
downloadmariadb-git-36dd97239a7b3e84badb7fdc79b221c20cbfe38f.tar.gz
Fix BUG#2674: Crash if return system variable in stored procedures.
Had to initialize some fields in lex before parsing an SP read from mysql.proc. mysql-test/r/sp.result: New test case for BUG#2674. mysql-test/t/sp.test: New test case for BUG#2674. sql/sp.cc: We need to initialize some thd->lex fields (e.g. unit master pointers) since LEX::uncacheable() depends on this, and it's called when looking up system variables during parsing.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/sp.result6
-rw-r--r--mysql-test/t/sp.test10
2 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index bf515e4b4cd..2b91e8de270 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -989,6 +989,12 @@ call bug2614()|
call bug2614()|
drop table t3|
drop procedure bug2614|
+create function bug2674 () returns int
+return @@sort_buffer_size|
+select bug2674()|
+bug2674()
+262136
+drop function bug2674|
drop table if exists fac|
create table fac (n int unsigned not null primary key, f bigint unsigned)|
create procedure ifac(n int unsigned)
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 3cb88ec5717..fd6cb4a300a 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -1138,6 +1138,16 @@ call bug2614()|
drop table t3|
drop procedure bug2614|
+#
+# BUG#2674
+#
+
+create function bug2674 () returns int
+ return @@sort_buffer_size|
+
+select bug2674()|
+drop function bug2674|
+
#
# Some "real" examples