diff --git a/storage/innobase/api/api0api.cc b/storage/innobase/api/api0api.cc index 4ae0311d28b..ec0fe41aeaf 100644 --- a/storage/innobase/api/api0api.cc +++ b/storage/innobase/api/api0api.cc @@ -2911,7 +2911,7 @@ dberr_t ib_sdi_get_keys(uint32_t tablespace_id, ib_sdi_vector_t *ib_sdi_vector, ib_tuple_read_u32(tuple, 0, &ts.type); ib_tuple_read_u64(tuple, 1, reinterpret_cast(&ts.id)); - ib_sdi_vector->sdi_vector->m_vec.push_back(ts); + ib_sdi_vector->sdi_vector->m_vec.push_back(std::move(ts)); } while (ib_cursor_next(ib_crsr) != DB_END_OF_INDEX); diff --git a/storage/innobase/arch/arch0page.cc b/storage/innobase/arch/arch0page.cc index 6a63789ce9a..d05c0dd75e4 100644 --- a/storage/innobase/arch/arch0page.cc +++ b/storage/innobase/arch/arch0page.cc @@ -392,7 +392,7 @@ void Arch_File_Ctx::save_reset_point_in_mem(lsn_t lsn, Arch_Page_Pos pos) { reset_file.m_file_index = current_file_index; reset_file.m_lsn = lsn; reset_file.m_start_point.push_back(reset_point); - m_reset.push_back(reset_file); + m_reset.push_back(std::move(reset_file)); } bool Arch_File_Ctx::find_reset_point(lsn_t check_lsn, Arch_Point &reset_point) { diff --git a/storage/innobase/arch/arch0recv.cc b/storage/innobase/arch/arch0recv.cc index fe98d82af7d..b643047a8bf 100644 --- a/storage/innobase/arch/arch0recv.cc +++ b/storage/innobase/arch/arch0recv.cc @@ -731,7 +731,7 @@ dberr_t Arch_File_Ctx::Recovery::parse_reset_points( m_file_ctx.m_reset.push_back(reset_file); } - info.m_last_reset_file = reset_file; + info.m_last_reset_file = std::move(reset_file); return err; } diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc index 3278003142f..99d4a75e478 100644 --- a/storage/innobase/buf/buf0dblwr.cc +++ b/storage/innobase/buf/buf0dblwr.cc @@ -3414,7 +3414,7 @@ dberr_t dblwr::recv::load(recv::Pages *pages) noexcept { } if (Fil_path::has_suffix(DWR, file.c_str())) { - dblwr_files.push_back(file); + dblwr_files.push_back(std::move(file)); } }); @@ -3525,7 +3525,7 @@ dberr_t dblwr::recv::reduced_load(recv::Pages *pages) noexcept { } if (Fil_path::has_suffix(BWR, file.c_str())) { - dblwr_files.push_back(file); + dblwr_files.push_back(std::move(file)); } }); /* We have to use all the dblwr files for recovery. */ diff --git a/storage/innobase/fil/fil0fil.cc b/storage/innobase/fil/fil0fil.cc index 7c42bbe057f..4554f92e28d 100644 --- a/storage/innobase/fil/fil0fil.cc +++ b/storage/innobase/fil/fil0fil.cc @@ -10758,7 +10758,7 @@ void Tablespace_dirs::add_path(const std::string &path_in, bool is_undo_dir) { } } - m_dirs.push_back(Tablespace_files{found_path.path()}); + m_dirs.push_back(std::move(Tablespace_files{found_path.path()})); return; } @@ -11346,10 +11346,10 @@ dberr_t Tablespace_dirs::scan() { using Value = Scanned_files::value_type; if (Fil_path::has_suffix(IBD, file.c_str())) { - ibd_files.push_back(Value{count, file}); + ibd_files.push_back(std::move(Value{count, file})); } else if (Fil_path::is_undo_tablespace_name(file)) { - undo_files.push_back(Value{count, file}); + undo_files.push_back(std::move(Value{count, file})); } if (std::chrono::steady_clock::now() - start_time >= PRINT_INTERVAL) { diff --git a/storage/innobase/fsp/fsp0space.cc b/storage/innobase/fsp/fsp0space.cc index b3393765023..0baead3ecbf 100644 --- a/storage/innobase/fsp/fsp0space.cc +++ b/storage/innobase/fsp/fsp0space.cc @@ -147,7 +147,7 @@ dberr_t Tablespace::add_datafile(const char *datafile_added) { /* Now add a new Datafile and set the filepath using the m_path created above. */ - m_files.push_back(value); + m_files.push_back(std::move(value)); Datafile *datafile = &m_files.back(); diff --git a/storage/innobase/fsp/fsp0sysspace.cc b/storage/innobase/fsp/fsp0sysspace.cc index 6839ee3eb97..de69848ca8f 100644 --- a/storage/innobase/fsp/fsp0sysspace.cc +++ b/storage/innobase/fsp/fsp0sysspace.cc @@ -277,7 +277,7 @@ bool SysTablespace::parse_params(const char *filepath_spec, bool supports_raw) { } } - m_files.push_back(Datafile(filepath, flags(), size, order)); + m_files.push_back(std::move(Datafile(filepath, flags(), size, order))); Datafile *datafile = &m_files.back(); datafile->make_filepath(path(), filepath, NO_EXT); diff --git a/storage/innobase/fts/fts0que.cc b/storage/innobase/fts/fts0que.cc index ff360ea7857..5fb1aa1823f 100644 --- a/storage/innobase/fts/fts0que.cc +++ b/storage/innobase/fts/fts0que.cc @@ -565,7 +565,7 @@ static void fts_ranking_words_add( rbt_add_node(query->word_map, &parent, &new_word); ut_ad(rbt_validate(query->word_map)); - query->word_vector->push_back(new_word); + query->word_vector->push_back(std::move(new_word)); } /* Check words len */ diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 5f01763770e..4d664643fa5 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -19100,8 +19100,8 @@ struct ShowStatus { @param[in] count The latch metrics */ void operator()(const Count *count) UNIV_NOTHROW { if (count->m_spins > 0 || count->m_waits > 0) { - m_values->push_back( - Value(m_name, count->m_spins, count->m_waits, count->m_calls)); + m_values->push_back(std::move( + Value(m_name, count->m_spins, count->m_waits, count->m_calls))); } } diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index a6defd90fd8..b3e837efa02 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -3551,7 +3551,7 @@ static int i_s_innodb_temp_table_info_fill_table( innodb_temp_table_populate_cache(table, ¤t_temp_table_info); - all_temp_info_cache.push_back(current_temp_table_info); + all_temp_info_cache.push_back(std::move(current_temp_table_info)); } dict_sys_mutex_exit(); diff --git a/storage/innobase/lob/lob0util.cc b/storage/innobase/lob/lob0util.cc index b87f737bf1c..3b42d239799 100644 --- a/storage/innobase/lob/lob0util.cc +++ b/storage/innobase/lob/lob0util.cc @@ -150,7 +150,7 @@ dberr_t get_affected_index_entries(const ref_t &ref, dict_index_t *index, if (block != nullptr) { entry.read(entry_mem); - entries.push_back(entry_mem); + entries.push_back(std::move(entry_mem)); } } diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 43b9747c0fa..9747d1ef872 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -3650,7 +3650,7 @@ void Dir_Walker::walk_posix(const Path &basedir, bool recursive, Function &&f) { Stack directories; - directories.push(Entry(basedir, 0)); + directories.push(std::move(Entry(basedir, 0))); while (!directories.empty()) { Entry current = directories.top(); @@ -3705,7 +3705,7 @@ void Dir_Walker::walk_posix(const Path &basedir, bool recursive, Function &&f) { } if (is_directory(path) && recursive) { - directories.push(Entry(path, current.m_depth + 1)); + directories.push(std::move(Entry(path, current.m_depth + 1))); } else { f(path, current.m_depth + 1); } @@ -4918,7 +4918,7 @@ void Dir_Walker::walk_win32(const Path &basedir, bool recursive, Function &&f) { StringCchCat(directory, MAX_PATH, TEXT("*")); } - directories.push(Entry(directory, 0)); + directories.push(std::move(Entry(directory, 0))); using Type = std::codecvt_utf8; using Converter = std::wstring_convert; @@ -4973,7 +4973,7 @@ void Dir_Walker::walk_win32(const Path &basedir, bool recursive, Function &&f) { using Value = Stack::value_type; - directories.push(Value{path, current.m_depth + 1}); + directories.push(std::move(Value{path, current.m_depth + 1})); } else { f(path, current.m_depth + 1); diff --git a/storage/innobase/sync/sync0debug.cc b/storage/innobase/sync/sync0debug.cc index 7f7078dd9bb..26deb7ae1da 100644 --- a/storage/innobase/sync/sync0debug.cc +++ b/storage/innobase/sync/sync0debug.cc @@ -265,7 +265,7 @@ struct LatchDebug { if (*latch->get_name() != '.' && latch->get_level() != SYNC_LEVEL_VARYING) { Latches *latches = thread_latches(true); - latches->push_back(Latched(latch, level)); + latches->push_back(std::move(Latched(latch, level))); } } @@ -304,9 +304,9 @@ struct LatchDebug { } if (it == latches->end()) { - latches->push_back(Latched(latch, level)); + latches->push_back(std::move(Latched(latch, level))); } else { - latches->insert(it, Latched(latch, level)); + latches->insert(it, std::move(Latched(latch, level))); } } } @@ -1720,7 +1720,7 @@ void Sync_point::add(const THD *thd, const std::string &target) noexcept { r1->m_targets.push_back(target); } } else { - s_sync_points.push_back(Sync_point{thd}); + s_sync_points.push_back(std::move(Sync_point{thd})); s_sync_points.back().m_targets.push_back(target); } } diff --git a/storage/innobase/trx/trx0rseg.cc b/storage/innobase/trx/trx0rseg.cc index 7893771cfa9..2726233fd52 100644 --- a/storage/innobase/trx/trx0rseg.cc +++ b/storage/innobase/trx/trx0rseg.cc @@ -443,7 +443,7 @@ trx_rseg_t *trx_rseg_mem_create(ulint id, space_id_t space_id, ut_ad(space_id == TRX_SYS_SPACE || (srv_is_upgrade_mode != undo::is_reserved(space_id))); - purge_queue->push(elem); + purge_queue->push(std::move(elem)); } } else { rseg->last_page_no = FIL_NULL;