From b895941468f0066462729ac28ed9763756fe135c Mon Sep 17 00:00:00 2001 From: Laurynas Biveinis Date: Fri, 5 May 2023 11:52:18 +0300 Subject: [PATCH] Fix the remaining -Wunqualified-std-cast-call warnings This is follow-up to 023fcdb332cf6502b2e34188cc6a91dc685b0174, handling the differences between the current codebase and the one at that commit's time. --- sql/join_optimizer/access_path.cc | 67 ++++++++++++----------- sql/join_optimizer/explain_access_path.cc | 24 ++++---- sql/sql_delete.cc | 2 +- 3 files changed, 47 insertions(+), 46 deletions(-) diff --git a/sql/join_optimizer/access_path.cc b/sql/join_optimizer/access_path.cc index e2d8260dda50..da1c1262e73b 100644 --- a/sql/join_optimizer/access_path.cc +++ b/sql/join_optimizer/access_path.cc @@ -462,7 +462,7 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( return nullptr; } } - iterator = NewIterator(thd, mem_root, move(child)); + iterator = NewIterator(thd, mem_root, std::move(child)); break; } case AccessPath::ZERO_ROWS_AGGREGATED: @@ -479,7 +479,7 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( } iterator = NewIterator( thd, mem_root, param.table_function, param.table, - move(table_iterator)); + std::move(table_iterator)); break; } case AccessPath::UNQUALIFIED_COUNT: @@ -497,9 +497,9 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( if (inner == nullptr) { return nullptr; } - iterator = NewIterator(thd, mem_root, move(outer), - move(inner), param.join_type, - param.pfs_batch_mode); + iterator = NewIterator( + thd, mem_root, std::move(outer), std::move(inner), param.join_type, + param.pfs_batch_mode); break; } case AccessPath::NESTED_LOOP_SEMIJOIN_WITH_DUPLICATE_REMOVAL: { @@ -515,8 +515,8 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( return nullptr; } iterator = NewIterator( - thd, mem_root, move(outer), move(inner), param.table, param.key, - param.key_len); + thd, mem_root, std::move(outer), std::move(inner), param.table, + param.key, param.key_len); break; } case AccessPath::BKA_JOIN: { @@ -538,11 +538,11 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( MultiRangeRowIterator *mrr_iterator = down_cast( mrr_path->iterator->real_iterator()); iterator = NewIterator( - thd, mem_root, move(outer), + thd, mem_root, std::move(outer), GetUsedTables(param.outer, /*include_pruned_tables=*/true), - move(inner), thd->variables.join_buff_size, param.mrr_length_per_rec, - param.rec_per_key, param.store_rowids, param.tables_to_get_rowid_for, - mrr_iterator, param.join_type); + std::move(inner), thd->variables.join_buff_size, + param.mrr_length_per_rec, param.rec_per_key, param.store_rowids, + param.tables_to_get_rowid_for, mrr_iterator, param.join_type); break; } case AccessPath::HASH_JOIN: { @@ -608,12 +608,12 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( : nullptr; iterator = NewIterator( - thd, mem_root, move(inner), + thd, mem_root, std::move(inner), GetUsedTables(param.inner, /*include_pruned_tables=*/true), - estimated_build_rows, move(outer), + estimated_build_rows, std::move(outer), GetUsedTables(param.outer, /*include_pruned_tables=*/true), param.store_rowids, param.tables_to_get_rowid_for, - thd->variables.join_buff_size, move(conditions), + thd->variables.join_buff_size, std::move(conditions), param.allow_spill_to_disk, join_type, join_predicate->expr->join_conditions, probe_input_batch_mode, hash_table_generation); @@ -626,7 +626,7 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( if (child == nullptr) { return nullptr; } - iterator = NewIterator(thd, mem_root, move(child), + iterator = NewIterator(thd, mem_root, std::move(child), param.condition); break; } @@ -642,7 +642,7 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( : lrint(param.child->num_output_rows); Filesort *filesort = param.filesort; iterator = NewIterator( - thd, mem_root, filesort, move(child), num_rows_estimate, + thd, mem_root, filesort, std::move(child), num_rows_estimate, param.tables_to_get_rowid_for, examined_rows); if (filesort->m_remove_duplicates) { filesort->tables[0]->duplicate_removal_iterator = @@ -663,7 +663,7 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( Prealloced_array tables = GetUsedTables(param.child, /*include_pruned_tables=*/true); iterator = NewIterator( - thd, mem_root, move(child), join, + thd, mem_root, std::move(child), join, TableCollection(tables, /*store_rowids=*/false, /*tables_to_get_rowid_for=*/0), param.rollup); @@ -684,8 +684,8 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( return nullptr; } iterator = NewIterator( - thd, mem_root, move(subquery_iterator), param.temp_table_param, - param.table, move(table_iterator), join, param.ref_slice); + thd, mem_root, std::move(subquery_iterator), param.temp_table_param, + param.table, std::move(table_iterator), join, param.ref_slice); break; } case AccessPath::LIMIT_OFFSET: { @@ -702,7 +702,7 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( send_records = &join->send_records; } iterator = NewIterator( - thd, mem_root, move(child), param.limit, param.offset, + thd, mem_root, std::move(child), param.limit, param.offset, param.count_all_rows, param.reject_multiple_rows, send_records); break; } @@ -714,7 +714,7 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( return nullptr; } iterator = NewIterator( - thd, mem_root, move(child), param.temp_table_param, param.table, + thd, mem_root, std::move(child), param.temp_table_param, param.table, param.provide_rowid, param.join, param.ref_slice); break; } @@ -776,7 +776,7 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( JOIN *subjoin = param->ref_slice == -1 ? nullptr : query_blocks[0].join; iterator = NewIterator( thd, mem_root, std::move(query_blocks), param->table, - move(table_iterator), param->cte, param->unit, subjoin, + std::move(table_iterator), param->cte, param->unit, subjoin, param->ref_slice, param->rematerialize, param->limit_rows, param->reject_multiple_rows); @@ -804,7 +804,7 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( return nullptr; } iterator = NewIterator( - thd, mem_root, move(table_iterator), param.table_list, + thd, mem_root, std::move(table_iterator), param.table_list, param.condition); break; } @@ -820,7 +820,8 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( return nullptr; } } - iterator = NewIterator(thd, mem_root, move(children)); + iterator = + NewIterator(thd, mem_root, std::move(children)); break; } case AccessPath::WINDOW: { @@ -832,10 +833,10 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( } if (param.needs_buffering) { iterator = NewIterator( - thd, mem_root, move(child), param.temp_table_param, join, + thd, mem_root, std::move(child), param.temp_table_param, join, param.ref_slice); } else { - iterator = NewIterator(thd, mem_root, move(child), + iterator = NewIterator(thd, mem_root, std::move(child), param.temp_table_param, join, param.ref_slice); } @@ -848,7 +849,7 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( if (child == nullptr) { return nullptr; } - iterator = NewIterator(thd, mem_root, move(child), + iterator = NewIterator(thd, mem_root, std::move(child), param.weedout_table, param.tables_to_get_rowid_for); break; @@ -861,7 +862,7 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( return nullptr; } iterator = NewIterator( - thd, mem_root, move(child), join, param.group_items, + thd, mem_root, std::move(child), join, param.group_items, param.group_items_size); break; } @@ -873,7 +874,7 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( return nullptr; } iterator = NewIterator( - thd, mem_root, move(child), param.table, param.key, + thd, mem_root, std::move(child), param.table, param.key, param.loosescan_key_len); break; } @@ -891,8 +892,8 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( return nullptr; } iterator = NewIterator( - thd, mem_root, param.table_scan_path->table_scan().table, move(child), - move(table_scan_iterator), param.used_ref); + thd, mem_root, param.table_scan_path->table_scan().table, + std::move(child), std::move(table_scan_iterator), param.used_ref); break; } case AccessPath::CACHE_INVALIDATOR: { @@ -902,8 +903,8 @@ unique_ptr_destroy_only CreateIteratorFromAccessPath( if (child == nullptr) { return nullptr; } - iterator = NewIterator(thd, mem_root, - move(child), param.name); + iterator = NewIterator( + thd, mem_root, std::move(child), param.name); break; } case AccessPath::DELETE_ROWS: { diff --git a/sql/join_optimizer/explain_access_path.cc b/sql/join_optimizer/explain_access_path.cc index 9ec46853eed2..a1dde049c741 100644 --- a/sql/join_optimizer/explain_access_path.cc +++ b/sql/join_optimizer/explain_access_path.cc @@ -489,7 +489,7 @@ ExplainData ExplainAccessPath(const AccessPath *path, JOIN *join) { } str += table->file->explain_extra(); - description.push_back(move(str)); + description.push_back(std::move(str)); AddChildrenFromPushedCondition(table, &children); break; } @@ -509,7 +509,7 @@ ExplainData ExplainAccessPath(const AccessPath *path, JOIN *join) { ItemToString(table->file->pushed_idx_cond); } str += table->file->explain_extra(); - description.push_back(move(str)); + description.push_back(std::move(str)); AddChildrenFromPushedCondition(table, &children); break; } @@ -527,7 +527,7 @@ ExplainData ExplainAccessPath(const AccessPath *path, JOIN *join) { ItemToString(table->file->pushed_idx_cond); } str += table->file->explain_extra(); - description.push_back(move(str)); + description.push_back(std::move(str)); AddChildrenFromPushedCondition(table, &children); break; } @@ -544,7 +544,7 @@ ExplainData ExplainAccessPath(const AccessPath *path, JOIN *join) { ItemToString(table->file->pushed_idx_cond); } str += table->file->explain_extra(); - description.push_back(move(str)); + description.push_back(std::move(str)); AddChildrenFromPushedCondition(table, &children); break; } @@ -564,7 +564,7 @@ ExplainData ExplainAccessPath(const AccessPath *path, JOIN *join) { RefToString(*path->pushed_join_ref().ref, key, /*include_nulls=*/false) + ")" + table->file->explain_extra(); - description.push_back(move(str)); + description.push_back(std::move(str)); break; } case AccessPath::FULL_TEXT_SEARCH: { @@ -600,7 +600,7 @@ ExplainData ExplainAccessPath(const AccessPath *path, JOIN *join) { ItemToString(table->file->pushed_idx_cond); } str += table->file->explain_extra(); - description.push_back(move(str)); + description.push_back(std::move(str)); AddChildrenFromPushedCondition(table, &children); break; } @@ -673,7 +673,7 @@ ExplainData ExplainAccessPath(const AccessPath *path, JOIN *join) { ItemToString(table->file->pushed_idx_cond); } str += table->file->explain_extra(); - description.push_back(move(str)); + description.push_back(std::move(str)); AddChildrenFromPushedCondition(table, &children); break; } @@ -753,7 +753,7 @@ ExplainData ExplainAccessPath(const AccessPath *path, JOIN *join) { ret += ItemToString(cond); } - description.push_back(move(ret)); + description.push_back(std::move(ret)); children.push_back({path->hash_join().outer}); children.push_back({path->hash_join().inner, "Hash"}); break; @@ -798,7 +798,7 @@ ExplainData ExplainAccessPath(const AccessPath *path, JOIN *join) { path->sort().filesort->limit); ret += buf; } - description.push_back(move(ret)); + description.push_back(std::move(ret)); children.push_back({path->sort().child}); break; } @@ -830,7 +830,7 @@ ExplainData ExplainAccessPath(const AccessPath *path, JOIN *join) { ret += ItemToString(*item); } } - description.push_back(move(ret)); + description.push_back(std::move(ret)); children.push_back({path->aggregate().child}); break; } @@ -914,7 +914,7 @@ ExplainData ExplainAccessPath(const AccessPath *path, JOIN *join) { first = false; } } - description.push_back(move(buf)); + description.push_back(std::move(buf)); children.push_back({path->window().child}); break; } @@ -989,7 +989,7 @@ ExplainData ExplainAccessPath(const AccessPath *path, JOIN *join) { ret += ")"; } ret += " IS NULL"; - description.push_back(move(ret)); + description.push_back(std::move(ret)); children.push_back({path->alternative().child}); children.push_back({path->alternative().table_scan_path}); break; diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 6de3c29fe8b3..2f4c8653d741 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -1022,7 +1022,7 @@ bool Query_result_delete::optimize() { auto tempfile = make_unique_destroy_only( thd->mem_root, refpos_order_cmp, table->file, table->file->ref_length, thd->variables.sortbuff_size); - if (tempfile == nullptr || tempfiles.push_back(move(tempfile)) || + if (tempfile == nullptr || tempfiles.push_back(std::move(tempfile)) || tables.push_back(table)) { return true; /* purecov: inspected */ }