summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorunknown <malff/marcsql@weblab.(none)>2007-04-25 11:38:11 -0600
committerunknown <malff/marcsql@weblab.(none)>2007-04-25 11:38:11 -0600
commitc49e378ac4a690220d86c11ef40f2382848c6d30 (patch)
treed30571530b7aa0a8a10c4649da8ec7083b2621d3 /sql/sql_parse.cc
parent6f5cacfae89cdd7ef4498ab73b4213117a118e9b (diff)
downloadmariadb-git-c49e378ac4a690220d86c11ef40f2382848c6d30.tar.gz
code review fix
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 0505f0d3574..22689a3dfa1 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -5990,16 +5990,14 @@ void mysql_parse(THD *thd, const char *inBuf, uint length,
- first, call query_cache_send_result_to_client,
- second, if caching failed, initialise the lexical and syntactic parser.
The problem is that the query cache depends on a clean initialization
- of the thd and thd->lex structures, which happen to be implemented
- by:
+ of (among others) lex->safe_to_cache_query and thd->server_status,
+ which are reset respectively in
- lex_start()
- mysql_reset_thd_for_next_command()
So, initializing the lexical analyser *before* using the query cache
is required for the cache to work properly.
FIXME: cleanup the dependencies in the code to simplify this.
*/
- Lex_input_stream lip(thd, inBuf, length);
- thd->m_lip= &lip;
lex_start(thd);
mysql_reset_thd_for_next_command(thd);
@@ -6010,6 +6008,9 @@ void mysql_parse(THD *thd, const char *inBuf, uint length,
sp_cache_flush_obsolete(&thd->sp_proc_cache);
sp_cache_flush_obsolete(&thd->sp_func_cache);
+ Lex_input_stream lip(thd, inBuf, length);
+ thd->m_lip= &lip;
+
int err= MYSQLparse(thd);
*found_semicolon= lip.found_semicolon;