summaryrefslogtreecommitdiff
path: root/sql/sql_parse.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-07-21 22:44:12 +0300
committerunknown <bell@sanja.is.com.ua>2004-07-21 22:44:12 +0300
commitff4aa03dc5e20501fbb3541dfef55f13cd7ca221 (patch)
tree10f2d2b4f13553227b0f0cc5c9801478bd1aca1b /sql/sql_parse.cc
parentbf95f9195fe431841fe1e29e6b82c9f47ec52ad3 (diff)
downloadmariadb-git-ff4aa03dc5e20501fbb3541dfef55f13cd7ca221.tar.gz
LEX initialization fixed
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r--sql/sql_parse.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index e83868bac7c..b69d582f30b 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -3850,7 +3850,7 @@ bool my_yyoverflow(short **yyss, YYSTYPE **yyvs, ulong *yystacksize)
****************************************************************************/
void
-mysql_init_query(THD *thd)
+mysql_init_query(THD *thd, uchar *buf, uint length)
{
DBUG_ENTER("mysql_init_query");
LEX *lex= thd->lex;
@@ -3875,6 +3875,7 @@ mysql_init_query(THD *thd)
lex->lock_option= TL_READ;
lex->found_colon= 0;
lex->safe_to_cache_query= 1;
+ lex_start(thd, buf, length);
thd->select_number= lex->select_lex.select_number= 1;
thd->free_list= 0;
thd->total_warn_count=0; // Warnings for this query
@@ -4012,10 +4013,10 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
{
DBUG_ENTER("mysql_parse");
- mysql_init_query(thd);
+ mysql_init_query(thd, (uchar*) inBuf, length);
if (query_cache_send_result_to_client(thd, inBuf, length) <= 0)
{
- LEX *lex=lex_start(thd, (uchar*) inBuf, length);
+ LEX *lex= thd->lex;
if (!yyparse((void *)thd) && ! thd->is_fatal_error)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
@@ -4062,11 +4063,10 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length)
{
- LEX *lex;
+ LEX *lex= thd->lex;
bool error= 0;
- mysql_init_query(thd);
- lex= lex_start(thd, (uchar*) inBuf, length);
+ mysql_init_query(thd, (uchar*) inBuf, length);
if (!yyparse((void*) thd) && ! thd->is_fatal_error &&
all_tables_not_ok(thd,(TABLE_LIST*) lex->select_lex.table_list.first))
error= 1; /* Ignore question */