diff options
author | tulin@dl145b.mysql.com <> | 2005-07-19 21:56:10 +0200 |
---|---|---|
committer | tulin@dl145b.mysql.com <> | 2005-07-19 21:56:10 +0200 |
commit | a6c21a079163d2d09163cb4084ada38f4ddac929 (patch) | |
tree | 91e9f17b6b183df5ad37be93a13365d7d0f0d7f8 /sql/sp_head.cc | |
parent | 519c5564b15cf4b88719eb0e4cb4dc5247891425 (diff) | |
parent | e3af1b6ec6ecd95b6f42192c75af08fcc7c3618a (diff) | |
download | mariadb-git-a6c21a079163d2d09163cb4084ada38f4ddac929.tar.gz |
merge
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; |