diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2022-07-12 09:25:08 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2022-07-14 09:46:06 +0200 |
commit | 92a328099800486fe585a54d31ddf84c02ec6ae0 (patch) | |
tree | c4ba021d48bf91b26f589e55209eded29fec5d60 | |
parent | 49e14000eeb245ea27e9207d2f63cb0a28be1ca9 (diff) | |
download | mariadb-git-92a328099800486fe585a54d31ddf84c02ec6ae0.tar.gz |
table_count was present twice in one class of LEX.
Remove table_count from Query_tables_list (not used, moved to MYSQL_LOCK).
Rename table_count from LEX to avoid mixing it with other counters of tables.
-rw-r--r-- | sql/sql_lex.h | 11 | ||||
-rw-r--r-- | sql/sql_parse.cc | 6 | ||||
-rw-r--r-- | sql/sql_prepare.cc | 2 | ||||
-rw-r--r-- | sql/sql_update.cc | 4 |
4 files changed, 7 insertions, 16 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h index bd7bd2f248c..d720d902bd7 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -1537,15 +1537,6 @@ public: Sroutine_hash_entry **sroutines_list_own_last; uint sroutines_list_own_elements; - /** - 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. @@ -3060,7 +3051,7 @@ public: stores total number of tables. For LEX representing multi-delete holds number of tables from which we will delete records. */ - uint table_count; + uint table_count_update; uint8 describe; bool analyze_stmt; /* TRUE<=> this is "ANALYZE $stmt" */ bool explain_json; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index df31862a92f..e9d2f2074b5 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -4758,7 +4758,7 @@ mysql_execute_command(THD *thd) if (likely(!thd->is_fatal_error)) { result= new (thd->mem_root) multi_delete(thd, aux_tables, - lex->table_count); + lex->table_count_update); if (likely(result)) { if (unlikely(select_lex->vers_setup_conds(thd, aux_tables))) @@ -9532,12 +9532,12 @@ bool multi_delete_set_locks_and_link_aux_tables(LEX *lex) TABLE_LIST *target_tbl; DBUG_ENTER("multi_delete_set_locks_and_link_aux_tables"); - lex->table_count= 0; + lex->table_count_update= 0; for (target_tbl= lex->auxiliary_table_list.first; target_tbl; target_tbl= target_tbl->next_local) { - lex->table_count++; + lex->table_count_update++; /* All tables in aux_tables must be found in FROM PART */ TABLE_LIST *walk= multi_delete_table_match(lex, target_tbl, tables); if (!walk) diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index ef9d7f9a703..71dc85c3100 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1446,7 +1446,7 @@ static int mysql_test_update(Prepared_statement *stmt, DBUG_ASSERT(update_source_table || table_list->view != 0); DBUG_PRINT("info", ("Switch to multi-update")); /* pass counter value */ - thd->lex->table_count= table_count; + thd->lex->table_count_update= table_count; /* convert to multiupdate */ DBUG_RETURN(2); } diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 66c3acedb23..85d7dd1ca92 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -365,7 +365,7 @@ int mysql_update(THD *thd, DBUG_ASSERT(update_source_table || table_list->view != 0); DBUG_PRINT("info", ("Switch to multi-update")); /* pass counter value */ - thd->lex->table_count= table_count; + thd->lex->table_count_update= table_count; /* convert to multiupdate */ DBUG_RETURN(2); } @@ -1710,7 +1710,7 @@ int mysql_multi_update_prepare(THD *thd) TABLE_LIST *table_list= lex->query_tables; TABLE_LIST *tl; Multiupdate_prelocking_strategy prelocking_strategy; - uint table_count= lex->table_count; + uint table_count= lex->table_count_update; DBUG_ENTER("mysql_multi_update_prepare"); /* |