1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

LEX initialization fixed

This commit is contained in:
bell@sanja.is.com.ua
2004-07-21 22:44:12 +03:00
parent 84d9b862f6
commit a1b6f6db0e
6 changed files with 18 additions and 20 deletions

View File

@ -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 */