Skip to content

Commit 5ef816f

Browse files
committed
Bug#34854806 UtilTransactions compilation warnings [mysql#3]
Missing initializers for m_verbosity and m_util_latest_gci storage/ndb/test/src/UtilTransactions.cpp:35:24: warning: 2 uninitialized fields at the end of the constructor call [clang-analyzer- optin.cplusplus.UninitializedObject] Removed unused member m_defaultClearMethod Change-Id: I46617df4a1ea3c3c56a8d82e999dcc01019232a7
1 parent d96eb16 commit 5ef816f

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

storage/ndb/test/include/UtilTransactions.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ typedef int (ReadCallBackFn)(NDBT_ResultRow*);
3131

3232
class UtilTransactions {
3333
public:
34-
Uint64 m_util_latest_gci;
34+
Uint64 m_util_latest_gci{0};
3535
Uint32 get_high_latest_gci()
3636
{
37+
assert(m_util_latest_gci != 0);
3738
return Uint32(Uint64(m_util_latest_gci >> 32));
3839
}
3940
Uint32 get_low_latest_gci()
4041
{
42+
assert(m_util_latest_gci != 0);
4143
return Uint32(Uint64(m_util_latest_gci & 0xFFFFFFFF));
4244
}
4345
UtilTransactions(const NdbDictionary::Table&,
@@ -323,11 +325,10 @@ class UtilTransactions {
323325
bool skipNull=false);
324326

325327
protected:
326-
int m_defaultClearMethod;
327328
const NdbDictionary::Table& tab;
328329
const NdbDictionary::Index* idx;
329-
NdbConnection* pTrans;
330-
Uint32 m_verbosity;
330+
NdbConnection* pTrans{nullptr};
331+
Uint32 m_verbosity{0};
331332

332333
NdbOperation* getOperation(NdbConnection*,
333334
NdbOperation::OperationType);

storage/ndb/test/src/UtilTransactions.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,16 @@
3030

3131
UtilTransactions::UtilTransactions(const NdbDictionary::Table& _tab,
3232
const NdbDictionary::Index* _idx):
33-
tab(_tab), idx(_idx), pTrans(0)
33+
tab(_tab), idx(_idx)
3434
{
35-
m_defaultClearMethod = 3;
3635
}
3736

3837
UtilTransactions::UtilTransactions(Ndb* ndb,
3938
const char * name,
4039
const char * index) :
4140
tab(* ndb->getDictionary()->getTable(name)),
42-
idx(index ? ndb->getDictionary()->getIndex(index, name) : 0),
43-
pTrans(0)
41+
idx(index ? ndb->getDictionary()->getIndex(index, name) : 0)
4442
{
45-
m_defaultClearMethod = 3;
4643
}
4744

4845
#define RESTART_SCAN 99

0 commit comments

Comments
 (0)