Below is the list of changes that have just been committed into a local
5.0 repository of pem. When pem does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1945 05/07/15 17:24:19 pem@stripped +3 -0
Fixed BUG#9538: SProc: Creation fails if we try to SET system variable
using @@var_name in proc
Made sure we don't lose the tokenizer state when swapping lex in during SET
parsing.
sql/sp_head.cc
1.159 05/07/15 17:24:13 pem@stripped +6 -0
Keep lex->next_state when swapping lex during SP parsing (for SET mainly),
otherwise the tokenizer gets confused.
mysql-test/t/sp.test
1.131 05/07/15 17:24:13 pem@stripped +19 -0
New test case for BUG#9538.
mysql-test/r/sp.result
1.136 05/07/15 17:24:13 pem@stripped +13 -0
New test case for BUG#9538.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: pem
# Host: mysql.comhem.se
# Root: /home/pem/work/mysql-5.0
--- 1.135/mysql-test/r/sp.result 2005-07-15 11:34:42 +02:00
+++ 1.136/mysql-test/r/sp.result 2005-07-15 17:24:13 +02:00
@@ -3079,4 +3079,17 @@
delete from t1|
drop procedure bug9565_sub|
drop procedure bug9565|
+drop procedure if exists bug9538|
+create procedure bug9538()
+set @@sort_buffer_size = 1000000|
+set @x = @@sort_buffer_size|
+select @@sort_buffer_size|
+@@sort_buffer_size
+262136
+call bug9538()|
+select @@sort_buffer_size|
+@@sort_buffer_size
+1000000
+set @@sort_buffer_size = @x|
+drop procedure bug9538|
drop table t1,t2;
--- 1.130/mysql-test/t/sp.test 2005-07-15 11:34:42 +02:00
+++ 1.131/mysql-test/t/sp.test 2005-07-15 17:24:13 +02:00
@@ -3856,6 +3856,25 @@
#
+# BUG#9538: SProc: Creation fails if we try to SET system variable
+# using @@var_name in proc
+#
+--disable_warnings
+drop procedure if exists bug9538|
+--enable_warnings
+create procedure bug9538()
+ set @@sort_buffer_size = 1000000|
+
+set @x = @@sort_buffer_size|
+select @@sort_buffer_size|
+call bug9538()|
+select @@sort_buffer_size|
+set @@sort_buffer_size = @x|
+
+drop procedure bug9538|
+
+
+#
# BUG#NNNN: New bug synopsis
#
#--disable_warnings
--- 1.158/sql/sp_head.cc 2005-07-09 20:04:13 +02:00
+++ 1.159/sql/sp_head.cc 2005-07-15 17:24:13 +02:00
@@ -1023,6 +1023,7 @@
DBUG_ENTER("sp_head::reset_lex");
LEX *sublex;
LEX *oldlex= thd->lex;
+ my_lex_states state= oldlex->next_state; // Keep original next_state
(void)m_lex.push_front(oldlex);
thd->lex= sublex= new st_lex;
@@ -1030,6 +1031,11 @@
/* Reset most stuff. The length arguments doesn't matter here. */
lex_start(thd, oldlex->buf, (ulong) (oldlex->end_of_query - oldlex->ptr));
+ /*
+ * next_state is normally the same (0), but it happens that we swap lex in
+ * "mid-sentence", so we must restore it.
+ */
+ sublex->next_state= state;
/* We must reset ptr and end_of_query again */
sublex->ptr= oldlex->ptr;
sublex->end_of_query= oldlex->end_of_query;
| Thread |
|---|
| • bk commit into 5.0 tree (pem:1.1945) BUG#9538 | pem | 15 Jul |