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:
@ -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 */
|
||||
|
Reference in New Issue
Block a user