Skip to content

Commit d015948

Browse files
author
magnus.blaudd@oracle.com
committed
ndbapi examples
- fix warning(s) about ambigous else branch by adding braces
1 parent cd7e082 commit d015948

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

storage/ndb/ndbapi-examples/ndbapi_recattr_vs_record/main.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -671,10 +671,12 @@ static void do_read(Ndb &myNdb, ApiType accessType)
671671
APIERROR(myTransaction->getNdbError());
672672

673673
if (myTransaction->getNdbError().classification == NdbError::NoDataFound)
674+
{
674675
if (i == 3)
675676
std::cout << "Detected that deleted tuple doesn't exist!" << std::endl;
676677
else
677678
APIERROR(myTransaction->getNdbError());
679+
}
678680

679681
switch (accessType)
680682
{
@@ -773,11 +775,12 @@ static void do_mixed_read(Ndb &myNdb)
773775
APIERROR(myTransaction->getNdbError());
774776

775777
if (myTransaction->getNdbError().classification == NdbError::NoDataFound)
778+
{
776779
if (i == 3)
777780
std::cout << "Detected that deleted tuple doesn't exist!" << std::endl;
778781
else
779782
APIERROR(myTransaction->getNdbError());
780-
783+
}
781784

782785
if (i !=3) {
783786
printf(" %2d %2d %2d %d\n",

storage/ndb/ndbapi-examples/ndbapi_simple/ndbapi_simple.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -282,10 +282,12 @@ static void do_read(Ndb &myNdb)
282282
APIERROR(myTransaction->getNdbError());
283283

284284
if (myTransaction->getNdbError().classification == NdbError::NoDataFound)
285+
{
285286
if (i == 3)
286287
std::cout << "Detected that deleted tuple doesn't exist!" << std::endl;
287288
else
288289
APIERROR(myTransaction->getNdbError());
290+
}
289291

290292
if (i != 3) {
291293
printf(" %2d %2d\n", i, myRecAttr->u_32_value());

storage/ndb/ndbapi-examples/ndbapi_simple_dual/main.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -322,11 +322,13 @@ static void do_read(Ndb &myNdb, const char* table)
322322
if (myRecAttr == NULL) APIERROR(myTransaction->getNdbError());
323323

324324
if(myTransaction->execute( NdbTransaction::Commit ) == -1)
325+
{
325326
if (i == 3) {
326327
std::cout << "Detected that deleted tuple doesn't exist!" << std::endl;
327328
} else {
328329
APIERROR(myTransaction->getNdbError());
329330
}
331+
}
330332

331333
if (i != 3) {
332334
printf(" %2d %2d\n", i, myRecAttr->u_32_value());

storage/ndb/ndbapi-examples/ndbapi_simple_index/main.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
2+
Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -258,11 +258,13 @@ int main(int argc, char** argv)
258258

259259
if(myTransaction->execute( NdbTransaction::Commit,
260260
NdbOperation::AbortOnError ) == -1)
261+
{
261262
if (i == 3) {
262263
std::cout << "Detected that deleted tuple doesn't exist!\n";
263264
} else {
264265
APIERROR(myTransaction->getNdbError());
265266
}
267+
}
266268

267269
if (i != 3) {
268270
printf(" %2d %2d\n", i, myRecAttr->u_32_value());

0 commit comments

Comments
 (0)