Skip to content

Commit eda1b35

Browse files
committed
Bug#29801100 DECOUPLE NDB_RESTORE FROM NDBCLUSTER PLUGIN TABLE NAMES
Follow up patch to fix compiler warning: ndb_util_table.cc:52:50: warning: pass by value and use std::move [modernize-pass-by-value] Ndb_util_table::Ndb_util_table(Thd_ndb* thd_ndb, const std::string &db_name, ^~~~~~~~~~~~~~~~~~~ std::string Change-Id: I400bb1e9f36b35c072155d3487dd69b3e110f5f1
1 parent 3e754b1 commit eda1b35

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

sql/ndb_util_table.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
// Implements the interface defined in
2626
#include "sql/ndb_util_table.h"
2727

28+
#include <utility>
29+
2830
#include "my_base.h"
2931
#include "my_byteorder.h" // uint2korr
3032
#include "mysql_version.h"
@@ -49,12 +51,12 @@ class Db_name_guard {
4951
}
5052
};
5153

52-
Ndb_util_table::Ndb_util_table(Thd_ndb* thd_ndb, const std::string &db_name,
53-
const std::string &table_name, bool hidden)
54+
Ndb_util_table::Ndb_util_table(Thd_ndb* thd_ndb, std::string db_name,
55+
std::string table_name, bool hidden)
5456
: m_thd_ndb(thd_ndb),
5557
m_table_guard(thd_ndb->ndb->getDictionary()),
56-
m_db_name(db_name),
57-
m_table_name(table_name),
58+
m_db_name(std::move(db_name)),
59+
m_table_name(std::move(table_name)),
5860
m_hidden(hidden) {}
5961

6062
Ndb_util_table::~Ndb_util_table() {}

sql/ndb_util_table.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@
3333
#include "storage/ndb/include/ndbapi/NdbDictionary.hpp"
3434

3535
class NdbRecAttr;
36+
class Thd_ndb;
3637

3738
// Base class used for working with tables created in NDB by the
3839
// ndbcluster plugin
3940
class Ndb_util_table {
40-
class Thd_ndb* const m_thd_ndb;
41+
Thd_ndb* const m_thd_ndb;
4142
Ndb_table_guard m_table_guard;
4243
const std::string m_db_name;
4344
const std::string m_table_name;
@@ -54,8 +55,8 @@ class Ndb_util_table {
5455
void push_warning(const char* fmt, ...) const
5556
MY_ATTRIBUTE((format(printf, 2, 3)));
5657

57-
Ndb_util_table(class Thd_ndb*, const std::string& db_name,
58-
const std::string& table_name, bool hidden);
58+
Ndb_util_table(Thd_ndb*, std::string db_name,
59+
std::string table_name, bool hidden);
5960
~Ndb_util_table();
6061

6162
bool check_column_exist(const char* name) const;

0 commit comments

Comments
 (0)