From 11701780e0e30f23786dc294073ec91d76466edf Mon Sep 17 00:00:00 2001 From: Igor Babaev Date: Thu, 18 Aug 2022 20:40:04 -0700 Subject: [PATCH] Applied the changes introduced in the commit 92a328099800486fe585a54d31ddf84c02ec6ae0 Author: Oleksandr Byelkin Tue Jul 12 00:25:08 2022 Committer: Oleksandr Byelkin Thu Jul 14 00:46:06 2022 for the code of MDEV-28883. --- sql/sql_delete.cc | 2 +- sql/sql_lex.cc | 2 +- sql/sql_lex.h | 9 --------- sql/sql_yacc.yy | 2 +- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index aad463b6a53..75bd9bd4d10 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -1543,7 +1543,7 @@ bool Sql_cmd_delete::prepare_inner(THD *thd) } if (!(result= new (thd->mem_root) multi_delete(thd, aux_tables, - lex->table_count))) + lex->table_count_update))) { DBUG_RETURN(TRUE); } diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc index fc8e4bbd867..8a24d2febad 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -1305,7 +1305,7 @@ void LEX::start(THD *thd_arg) wild= 0; exchange= 0; - table_count= 0; + table_count_update= 0; DBUG_VOID_RETURN; } diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 5cfdfa12e7c..5a7fa14916f 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1780,15 +1780,6 @@ public: return (lock_tables_state == LTS_LOCKED); } - /** - Number of tables which were open by open_tables() and to be locked - by lock_tables(). - Note that we set this member only in some cases, when this value - needs to be passed from open_tables() to lock_tables() which are - separated by some amount of code. - */ - uint table_count; - /* These constructor and destructor serve for creation/destruction of Query_tables_list instances which are used as backup storage. diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 403377e1f71..4ddf427e4cc 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -13396,7 +13396,7 @@ delete_single_table: MYSQL_YYABORT; Select->table_list.save_and_clear(&Lex->auxiliary_table_list); /* Save the number of auxiliary tables */ - Lex->table_count= 1; + Lex->table_count_update= 1; Lex->query_tables= 0; Lex->query_tables_last= &Lex->query_tables;