mirror of
https://github.com/MariaDB/server.git
synced 2025-08-05 13:16:09 +03:00
MDEV-30469 (refactoring) Support ORDER BY and LIMIT for multi-table DELETE...
This patch includes a few changes to make the code easier to maintain: - Renamed SQL_I_List::link_in_list to SQL_I_List::insert. link_in_list was ambiguous as it could refer to a link or it could refer to a node - Remove field_name local variable in multi_update::initialize_tables because it is not used when creating the temporary tables - multi_update changes: - Move temp table callocs to init, a more natural location for them, and moved tables_to_update to const member variable so we don't recompute it. - Filter out jtbm tables and tables not in the update map, pushing those that will be updated into an update_targets container. This simplifies checks and loops in initialize_tables.
This commit is contained in:
@@ -2065,7 +2065,7 @@ dispatch_command_return dispatch_command(enum enum_server_command command, THD *
|
||||
*/
|
||||
table_list.select_lex= thd->lex->first_select_lex();
|
||||
thd->lex->
|
||||
first_select_lex()->table_list.link_in_list(&table_list,
|
||||
first_select_lex()->table_list.insert(&table_list,
|
||||
&table_list.next_local);
|
||||
thd->lex->add_to_query_tables(&table_list);
|
||||
|
||||
@@ -8003,7 +8003,7 @@ add_proc_to_list(THD* thd, Item *item)
|
||||
item_ptr = (Item**) (order+1);
|
||||
*item_ptr= item;
|
||||
order->item=item_ptr;
|
||||
thd->lex->proc_list.link_in_list(order, &order->next);
|
||||
thd->lex->proc_list.insert(order, &order->next);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -8024,7 +8024,7 @@ bool add_to_list(THD *thd, SQL_I_List<ORDER> &list, Item *item,bool asc)
|
||||
order->used=0;
|
||||
order->counter_used= 0;
|
||||
order->fast_field_copier_setup= 0;
|
||||
list.link_in_list(order, &order->next);
|
||||
list.insert(order, &order->next);
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
@@ -8202,7 +8202,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
|
||||
and SELECT.
|
||||
*/
|
||||
if (likely(!ptr->sequence))
|
||||
table_list.link_in_list(ptr, &ptr->next_local);
|
||||
table_list.insert(ptr, &ptr->next_local);
|
||||
ptr->next_name_resolution_table= NULL;
|
||||
#ifdef WITH_PARTITION_STORAGE_ENGINE
|
||||
ptr->partition_names= partition_names;
|
||||
|
Reference in New Issue
Block a user