diff options
author | pem@mysql.com <> | 2005-07-15 17:24:19 +0200 |
---|---|---|
committer | pem@mysql.com <> | 2005-07-15 17:24:19 +0200 |
commit | 7d7f34cf1c3aba2f0197101417070b4b049fb609 (patch) | |
tree | 43e64a64bd24fe23cfa5b17f4936a549674373b1 /sql/sp_head.cc | |
parent | 10db4d030f5fd1a919549479c7a59296245654f3 (diff) | |
download | mariadb-git-7d7f34cf1c3aba2f0197101417070b4b049fb609.tar.gz |
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.
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r-- | sql/sp_head.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 272456d8c8e..02c006d01ee 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1023,6 +1023,7 @@ sp_head::reset_lex(THD *thd) 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 @@ sp_head::reset_lex(THD *thd) /* 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; |