Skip to content

Commit d96eb16

Browse files
committed
Bug#34854806 UtilTransactions compilation warnings [#2]
Fix static analysis warnings for variables that are assigned but never used. storage/ndb/test/src/UtilTransactions.cpp:286:16: warning: Although the value stored to 'eof' is used in the enclosing expression, the value is never actually read from 'eof' [clang-analyzer-deadcode.DeadStores] Change-Id: I6d7b1fbae691a8d9750f57a8a11c2b12ff65041d
1 parent 36e03be commit d96eb16

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

storage/ndb/test/src/UtilTransactions.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -284,17 +284,18 @@ UtilTransactions::copyTableData(Ndb* pNdb,
284284
return NDBT_FAILED;
285285
}
286286
} while((eof = pOp->nextResult(false)) == 0);
287+
288+
if (eof == -1) break;
287289

288290
check = pTrans->execute(Commit, AbortOnError);
289-
if (check != -1)
290-
pTrans->getGCI(&m_util_latest_gci);
291-
pTrans->restart();
292291
if( check == -1 ) {
293-
const NdbError err = pTrans->getNdbError();
294-
NDB_ERR(err);
295-
closeTransaction(pNdb);
296-
return NDBT_FAILED;
292+
const NdbError err = pTrans->getNdbError();
293+
NDB_ERR(err);
294+
closeTransaction(pNdb);
295+
return NDBT_FAILED;
297296
}
297+
pTrans->getGCI(&m_util_latest_gci);
298+
pTrans->restart();
298299
}
299300
if (eof == -1) {
300301
const NdbError err = pTrans->getNdbError();
@@ -1114,7 +1115,6 @@ UtilTransactions::verifyOrderedIndex(Ndb* pNdb,
11141115
NDBT_ResultRow pkRow(tab);
11151116
NDBT_ResultRow indexRow(tab);
11161117

1117-
int res;
11181118
parallelism = 1;
11191119

11201120
while (true){
@@ -1266,7 +1266,7 @@ UtilTransactions::verifyOrderedIndex(Ndb* pNdb,
12661266
const BaseString scanRowString = scanRow.c_str();
12671267
while (true)
12681268
{
1269-
if ((res= iop->nextResult()) != 0){
1269+
if (iop->nextResult() != 0){
12701270
g_err << "Failed to find row using index: "
12711271
<< destIndex->getName() << endl;
12721272
g_err << " source index : " << (sourceIndex?sourceIndex->getName():"Table") << endl;
@@ -2178,6 +2178,8 @@ UtilTransactions::compare(Ndb* pNdb, const char* tab_name2, int flags){
21782178
retryAttempt= 0;
21792179
cmp.closeTransaction(pNdb);
21802180
} while((eof = pOp->nextResult(false)) == 0);
2181+
2182+
if (eof == -1) break;
21812183
}
21822184
if (eof == -1)
21832185
{

0 commit comments

Comments
 (0)