Commit 92a32809 authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

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.
parent 49e14000
...@@ -1537,15 +1537,6 @@ class Query_tables_list ...@@ -1537,15 +1537,6 @@ class Query_tables_list
Sroutine_hash_entry **sroutines_list_own_last; Sroutine_hash_entry **sroutines_list_own_last;
uint sroutines_list_own_elements; 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 These constructor and destructor serve for creation/destruction
of Query_tables_list instances which are used as backup storage. of Query_tables_list instances which are used as backup storage.
...@@ -3060,7 +3051,7 @@ struct LEX: public Query_tables_list ...@@ -3060,7 +3051,7 @@ struct LEX: public Query_tables_list
stores total number of tables. For LEX representing multi-delete stores total number of tables. For LEX representing multi-delete
holds number of tables from which we will delete records. holds number of tables from which we will delete records.
*/ */
uint table_count; uint table_count_update;
uint8 describe; uint8 describe;
bool analyze_stmt; /* TRUE<=> this is "ANALYZE $stmt" */ bool analyze_stmt; /* TRUE<=> this is "ANALYZE $stmt" */
bool explain_json; bool explain_json;
......
...@@ -4758,7 +4758,7 @@ mysql_execute_command(THD *thd) ...@@ -4758,7 +4758,7 @@ mysql_execute_command(THD *thd)
if (likely(!thd->is_fatal_error)) if (likely(!thd->is_fatal_error))
{ {
result= new (thd->mem_root) multi_delete(thd, aux_tables, result= new (thd->mem_root) multi_delete(thd, aux_tables,
lex->table_count); lex->table_count_update);
if (likely(result)) if (likely(result))
{ {
if (unlikely(select_lex->vers_setup_conds(thd, aux_tables))) 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) ...@@ -9532,12 +9532,12 @@ bool multi_delete_set_locks_and_link_aux_tables(LEX *lex)
TABLE_LIST *target_tbl; TABLE_LIST *target_tbl;
DBUG_ENTER("multi_delete_set_locks_and_link_aux_tables"); 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; for (target_tbl= lex->auxiliary_table_list.first;
target_tbl; target_tbl= target_tbl->next_local) 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 */ /* All tables in aux_tables must be found in FROM PART */
TABLE_LIST *walk= multi_delete_table_match(lex, target_tbl, tables); TABLE_LIST *walk= multi_delete_table_match(lex, target_tbl, tables);
if (!walk) if (!walk)
......
...@@ -1446,7 +1446,7 @@ static int mysql_test_update(Prepared_statement *stmt, ...@@ -1446,7 +1446,7 @@ static int mysql_test_update(Prepared_statement *stmt,
DBUG_ASSERT(update_source_table || table_list->view != 0); DBUG_ASSERT(update_source_table || table_list->view != 0);
DBUG_PRINT("info", ("Switch to multi-update")); DBUG_PRINT("info", ("Switch to multi-update"));
/* pass counter value */ /* pass counter value */
thd->lex->table_count= table_count; thd->lex->table_count_update= table_count;
/* convert to multiupdate */ /* convert to multiupdate */
DBUG_RETURN(2); DBUG_RETURN(2);
} }
......
...@@ -365,7 +365,7 @@ int mysql_update(THD *thd, ...@@ -365,7 +365,7 @@ int mysql_update(THD *thd,
DBUG_ASSERT(update_source_table || table_list->view != 0); DBUG_ASSERT(update_source_table || table_list->view != 0);
DBUG_PRINT("info", ("Switch to multi-update")); DBUG_PRINT("info", ("Switch to multi-update"));
/* pass counter value */ /* pass counter value */
thd->lex->table_count= table_count; thd->lex->table_count_update= table_count;
/* convert to multiupdate */ /* convert to multiupdate */
DBUG_RETURN(2); DBUG_RETURN(2);
} }
...@@ -1710,7 +1710,7 @@ int mysql_multi_update_prepare(THD *thd) ...@@ -1710,7 +1710,7 @@ int mysql_multi_update_prepare(THD *thd)
TABLE_LIST *table_list= lex->query_tables; TABLE_LIST *table_list= lex->query_tables;
TABLE_LIST *tl; TABLE_LIST *tl;
Multiupdate_prelocking_strategy prelocking_strategy; Multiupdate_prelocking_strategy prelocking_strategy;
uint table_count= lex->table_count; uint table_count= lex->table_count_update;
DBUG_ENTER("mysql_multi_update_prepare"); DBUG_ENTER("mysql_multi_update_prepare");
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment