summaryrefslogtreecommitdiff
path: root/ndb/test/src/HugoTransactions.cpp
diff options
context:
space:
mode:
authorunknown <ndbdev@eel.hemma.oreland.se>2004-08-05 22:19:52 +0200
committerunknown <ndbdev@eel.hemma.oreland.se>2004-08-05 22:19:52 +0200
commite223c07eb18147b809cb885ca267ca43f4870701 (patch)
tree682d9074ab3a5be1182ff2e58fe002059f0ddca1 /ndb/test/src/HugoTransactions.cpp
parent22306d0590f21ed8a43e92cee8fe591df4e88fe2 (diff)
parentebe79c0b9bbb7bf03cd0ed15e474fed6d74adbff (diff)
downloadmariadb-git-e223c07eb18147b809cb885ca267ca43f4870701.tar.gz
Merge joreland@bk-internal.mysql.com:irix
into eel.hemma.oreland.se:/ndb/clone-mysql-4.1-ndb-daily-2004-08-04 BitKeeper/etc/logging_ok: auto-union ndb/src/common/debugger/signaldata/SignalDataPrint.cpp: Auto merged ndb/src/cw/cpcd/Process.cpp: Auto merged ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Auto merged ndb/src/kernel/blocks/dbtux/Dbtux.hpp: Auto merged ndb/src/kernel/blocks/dbtux/DbtuxMeta.cpp: Auto merged ndb/src/kernel/blocks/dbtux/DbtuxTree.cpp: Auto merged ndb/src/mgmsrv/MgmtSrvr.cpp: Auto merged ndb/test/ndbapi/testBasic.cpp: Auto merged ndb/test/run-test/main.cpp: Auto merged ndb/test/src/HugoTransactions.cpp: Auto merged sql/ha_ndbcluster.cc: Auto merged
Diffstat (limited to 'ndb/test/src/HugoTransactions.cpp')
-rw-r--r--ndb/test/src/HugoTransactions.cpp102
1 files changed, 51 insertions, 51 deletions
diff --git a/ndb/test/src/HugoTransactions.cpp b/ndb/test/src/HugoTransactions.cpp
index 882b9185ea8..05039562c76 100644
--- a/ndb/test/src/HugoTransactions.cpp
+++ b/ndb/test/src/HugoTransactions.cpp
@@ -46,7 +46,7 @@ HugoTransactions::scanReadRecords(Ndb* pNdb,
int retryAttempt = 0;
const int retryMax = 100;
- int check;
+ int check, a;
NdbConnection *pTrans;
NdbScanOperation *pOp;
@@ -96,7 +96,7 @@ HugoTransactions::scanReadRecords(Ndb* pNdb,
return NDBT_FAILED;
}
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if((row.attributeStore(a) =
pOp->getValue(tab.getColumn(a)->getName())) == 0) {
ERR(pTrans->getNdbError());
@@ -220,7 +220,7 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb,
#else
int retryAttempt = 0;
const int retryMax = 100;
- int check;
+ int check, a;
NdbConnection *pTrans;
NdbOperation *pOp;
@@ -269,7 +269,7 @@ HugoTransactions::scanUpdateRecords1(Ndb* pNdb,
}
// Read all attributes from this table
- for(int a=0; a<tab.getNoOfColumns(); a++){
+ for(a=0; a<tab.getNoOfColumns(); a++){
if((row.attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == NULL){
ERR(pTrans->getNdbError());
pNdb->closeTransaction(pTrans);
@@ -387,7 +387,7 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb,
#else
int retryAttempt = 0;
const int retryMax = 100;
- int check;
+ int check, a;
NdbConnection *pTrans;
NdbOperation *pOp;
@@ -436,7 +436,7 @@ HugoTransactions::scanUpdateRecords2(Ndb* pNdb,
}
// Read all attributes from this table
- for(int a=0; a<tab.getNoOfColumns(); a++){
+ for(a=0; a<tab.getNoOfColumns(); a++){
if((row.attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == NULL){
ERR(pTrans->getNdbError());
pNdb->closeTransaction(pTrans);
@@ -553,7 +553,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb,
int parallelism){
int retryAttempt = 0;
const int retryMax = 100;
- int check;
+ int check, a;
NdbConnection *pTrans;
NdbScanOperation *pOp;
@@ -592,7 +592,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb,
}
// Read all attributes from this table
- for(int a=0; a<tab.getNoOfColumns(); a++){
+ for(a=0; a<tab.getNoOfColumns(); a++){
if((row.attributeStore(a) = pOp->getValue(tab.getColumn(a)->getName())) == NULL){
ERR(pTrans->getNdbError());
pNdb->closeTransaction(pTrans);
@@ -634,7 +634,7 @@ HugoTransactions::scanUpdateRecords3(Ndb* pNdb,
}
const int updates = calc.getUpdatesValue(&row) + 1;
const int r = calc.getIdValue(&row);
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if (tab.getColumn(a)->getPrimaryKey() == false){
if(setValueForAttr(pUp, a, r, updates ) != 0){
ERR(pTrans->getNdbError());
@@ -695,7 +695,7 @@ HugoTransactions::loadTable(Ndb* pNdb,
bool allowConstraintViolation,
int doSleep,
bool oneTrans){
- int check;
+ int check, a;
int retryAttempt = 0;
int retryMax = 5;
NdbConnection *pTrans;
@@ -763,7 +763,7 @@ HugoTransactions::loadTable(Ndb* pNdb,
}
// Set a calculated value for each attribute in this table
- for (int a = 0; a<tab.getNoOfColumns(); a++){
+ for (a = 0; a<tab.getNoOfColumns(); a++){
if(setValueForAttr(pOp, a, c+b, 0 ) != 0){
ERR(pTrans->getNdbError());
pNdb->closeTransaction(pTrans);
@@ -838,7 +838,7 @@ HugoTransactions::loadTable(Ndb* pNdb,
int
HugoTransactions::fillTable(Ndb* pNdb,
int batch){
- int check;
+ int check, a, b;
int retryAttempt = 0;
int retryMax = 5;
NdbConnection *pTrans;
@@ -869,7 +869,7 @@ HugoTransactions::fillTable(Ndb* pNdb,
return NDBT_FAILED;
}
- for(int b = 0; b < batch; b++){
+ for(b = 0; b < batch; b++){
pOp = pTrans->getNdbOperation(tab.getName());
if (pOp == NULL) {
@@ -886,7 +886,7 @@ HugoTransactions::fillTable(Ndb* pNdb,
}
// Set a calculated value for each attribute in this table
- for (int a = 0; a<tab.getNoOfColumns(); a++){
+ for (a = 0; a<tab.getNoOfColumns(); a++){
if(setValueForAttr(pOp, a, c+b, 0 ) != 0){
ERR(pTrans->getNdbError());
pNdb->closeTransaction(pTrans);
@@ -1025,7 +1025,7 @@ int
HugoTransactions::eventOperation(Ndb* pNdb, void* pstats,
int records) {
int myXXXXX = XXXXX++;
-
+ Uint32 i;
const char function[] = "HugoTransactions::eventOperation: ";
struct receivedEvent* recInsertEvent;
NdbAutoObjArrayPtr<struct receivedEvent>
@@ -1042,7 +1042,7 @@ HugoTransactions::eventOperation(Ndb* pNdb, void* pstats,
stats.n_duplicates = 0;
stats.n_inconsistent_gcis = 0;
- for (int i = 0; i < records; i++) {
+ for (i = 0; i < records; i++) {
recInsertEvent[i].pk = 0xFFFFFFFF;
recInsertEvent[i].count = 0;
recInsertEvent[i].event = 0xFFFFFFFF;
@@ -1150,7 +1150,7 @@ HugoTransactions::eventOperation(Ndb* pNdb, void* pstats,
}
g_info << "overrun " << overrun << " pk " << pk;
- for (int i = 1; i < noEventColumnName; i++) {
+ for (i = 1; i < noEventColumnName; i++) {
if (recAttr[i]->isNULL() >= 0) { // we have a value
g_info << " post[" << i << "]=";
if (recAttr[i]->isNULL() == 0) // we have a non-null value
@@ -1193,7 +1193,7 @@ HugoTransactions::eventOperation(Ndb* pNdb, void* pstats,
if (stats.n_updates > 0) {
stats.n_consecutive++;
}
- for (Uint32 i = 0; i < (Uint32)records/3; i++) {
+ for (i = 0; i < (Uint32)records/3; i++) {
if (recInsertEvent[i].pk != i) {
stats.n_consecutive ++;
ndbout << "missing insert pk " << i << endl;
@@ -1232,7 +1232,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb,
int r = 0;
int retryAttempt = 0;
const int retryMax = 100;
- int check;
+ int check, a;
NdbConnection *pTrans;
NdbOperation *pOp;
@@ -1284,7 +1284,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb,
}
// Define primary keys
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if (tab.getColumn(a)->getPrimaryKey() == true){
if(equalForAttr(pOp, a, r+b) != 0){
ERR(pTrans->getNdbError());
@@ -1295,7 +1295,7 @@ HugoTransactions::pkReadRecords(Ndb* pNdb,
}
// Define attributes to read
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if((rows[b]->attributeStore(a) =
pOp->getValue(tab.getColumn(a)->getName())) == 0) {
ERR(pTrans->getNdbError());
@@ -1358,7 +1358,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
int r = 0;
int retryAttempt = 0;
const int retryMax = 100;
- int check;
+ int check, a, b;
NdbConnection *pTrans;
NdbOperation *pOp;
@@ -1390,7 +1390,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
return NDBT_FAILED;
}
- for(int b = 0; b<batch && (r+b) < records; b++){
+ for(b = 0; b<batch && (r+b) < records; b++){
pOp = pTrans->getNdbOperation(tab.getName());
if (pOp == NULL) {
ERR(pTrans->getNdbError());
@@ -1406,7 +1406,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
}
// Define primary keys
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if (tab.getColumn(a)->getPrimaryKey() == true){
if(equalForAttr(pOp, a, r+b) != 0){
ERR(pTrans->getNdbError());
@@ -1417,7 +1417,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
}
// Define attributes to read
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if((rows[b]->attributeStore(a) =
pOp->getValue(tab.getColumn(a)->getName())) == 0) {
ERR(pTrans->getNdbError());
@@ -1443,7 +1443,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
return NDBT_FAILED;
}
- for(int b = 0; b<batch && (b+r)<records; b++){
+ for(b = 0; b<batch && (b+r)<records; b++){
if (calc.verifyRowValues(rows[b]) != 0){
pNdb->closeTransaction(pTrans);
return NDBT_FAILED;
@@ -1466,7 +1466,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
return NDBT_FAILED;
}
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if (tab.getColumn(a)->getPrimaryKey() == true){
if(equalForAttr(pUpdOp, a, r+b) != 0){
ERR(pTrans->getNdbError());
@@ -1476,7 +1476,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
}
}
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if (tab.getColumn(a)->getPrimaryKey() == false){
if(setValueForAttr(pUpdOp, a, r+b, updates ) != 0){
ERR(pTrans->getNdbError());
@@ -1526,7 +1526,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
int r = 0;
int retryAttempt = 0;
const int retryMax = 100;
- int check;
+ int check, a;
NdbConnection *pTrans;
while (r < records){
@@ -1566,7 +1566,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
}
// Define primary keys
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if (tab.getColumn(a)->getPrimaryKey() == true){
if(equalForAttr(pOp, a, r) != 0){
ERR(pTrans->getNdbError());
@@ -1577,7 +1577,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
}
// Read update value
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if (calc.isUpdateCol(a) == true){
if((row.attributeStore(a) =
pOp->getValue(tab.getColumn(a)->getName())) == 0) {
@@ -1622,7 +1622,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
}
// PKs
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if (tab.getColumn(a)->getPrimaryKey() == true){
if(equalForAttr(pUpdOp, a, r) != 0){
ERR(pTrans->getNdbError());
@@ -1633,7 +1633,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
}
// Update col
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if ((tab.getColumn(a)->getPrimaryKey() == false) &&
(calc.isUpdateCol(a) == true)){
@@ -1650,7 +1650,7 @@ HugoTransactions::pkInterpretedUpdateRecords(Ndb* pNdb,
}
// Remaining attributes
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if ((tab.getColumn(a)->getPrimaryKey() == false) &&
(calc.isUpdateCol(a) == false)){
if(setValueForAttr(pUpdOp, a, r, updates ) != 0){
@@ -1705,7 +1705,7 @@ HugoTransactions::pkDelRecords(Ndb* pNdb,
int r = 0;
int retryAttempt = 0;
const int retryMax = 100;
- int check;
+ int check, a;
NdbConnection *pTrans;
NdbOperation *pOp;
@@ -1750,7 +1750,7 @@ HugoTransactions::pkDelRecords(Ndb* pNdb,
}
// Define primary keys
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if (tab.getColumn(a)->getPrimaryKey() == true){
if(equalForAttr(pOp, a, r) != 0){
ERR(pTrans->getNdbError());
@@ -1820,7 +1820,7 @@ HugoTransactions::lockRecords(Ndb* pNdb,
int r = 0;
int retryAttempt = 0;
const int retryMax = 100;
- int check;
+ int check, a, b;
NdbConnection *pTrans;
NdbOperation *pOp;
@@ -1857,7 +1857,7 @@ HugoTransactions::lockRecords(Ndb* pNdb,
return NDBT_FAILED;
}
- for(int b = 0; (b<lockBatch) && (r+b < records); b++){
+ for(b = 0; (b<lockBatch) && (r+b < records); b++){
pOp = pTrans->getNdbOperation(tab.getName());
if (pOp == NULL) {
ERR(pTrans->getNdbError());
@@ -1873,7 +1873,7 @@ HugoTransactions::lockRecords(Ndb* pNdb,
}
// Define primary keys
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if (tab.getColumn(a)->getPrimaryKey() == true){
if(equalForAttr(pOp, a, r+b) != 0){
ERR(pTrans->getNdbError());
@@ -1884,7 +1884,7 @@ HugoTransactions::lockRecords(Ndb* pNdb,
}
// Define attributes to read
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if((rows[b]->attributeStore(a) =
pOp->getValue(tab.getColumn(a)->getName())) == 0) {
ERR(pTrans->getNdbError());
@@ -1967,7 +1967,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb,
int r = 0;
int retryAttempt = 0;
const int retryMax = 100;
- int check;
+ int check, a;
NdbConnection *pTrans;
NdbOperation *pOp;
NdbIndexScanOperation *sOp;
@@ -2039,7 +2039,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb,
}
// Define primary keys
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if (tab.getColumn(a)->getPrimaryKey() == true){
if(equalForAttr(pOp, a, r+b) != 0){
ERR(pTrans->getNdbError());
@@ -2050,7 +2050,7 @@ HugoTransactions::indexReadRecords(Ndb* pNdb,
}
// Define attributes to read
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if((rows[b]->attributeStore(a) =
pOp->getValue(tab.getColumn(a)->getName())) == 0) {
ERR(pTrans->getNdbError());
@@ -2118,7 +2118,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
int r = 0;
int retryAttempt = 0;
const int retryMax = 100;
- int check;
+ int check, a, b;
NdbConnection *pTrans;
NdbOperation *pOp;
NdbScanOperation * sOp;
@@ -2155,7 +2155,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
return NDBT_FAILED;
}
- for(int b = 0; b<batchsize && (b+r)<records; b++){
+ for(b = 0; b<batchsize && (b+r)<records; b++){
if(!ordered){
pOp = pTrans->getNdbIndexOperation(idxName, tab.getName());
if (pOp == NULL) {
@@ -2183,7 +2183,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
}
// Define primary keys
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if (tab.getColumn(a)->getPrimaryKey() == true){
if(equalForAttr(pOp, a, r+b) != 0){
ERR(pTrans->getNdbError());
@@ -2194,7 +2194,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
}
// Define attributes to read
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if((rows[b]->attributeStore(a) =
pOp->getValue(tab.getColumn(a)->getName())) == 0) {
ERR(pTrans->getNdbError());
@@ -2225,7 +2225,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
return NDBT_FAILED;
}
- for(int b = 0; b<batchsize && (b+r)<records; b++){
+ for(b = 0; b<batchsize && (b+r)<records; b++){
if (calc.verifyRowValues(rows[b]) != 0){
pNdb->closeTransaction(pTrans);
return NDBT_FAILED;
@@ -2254,7 +2254,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
}
if(!ordered){
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if (tab.getColumn(a)->getPrimaryKey() == true){
if(equalForAttr(pUpdOp, a, r+b) != 0){
ERR(pTrans->getNdbError());
@@ -2265,7 +2265,7 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
}
}
- for(int a = 0; a<tab.getNoOfColumns(); a++){
+ for(a = 0; a<tab.getNoOfColumns(); a++){
if (tab.getColumn(a)->getPrimaryKey() == false){
if(setValueForAttr(pUpdOp, a, r+b, updates ) != 0){
ERR(pTrans->getNdbError());
@@ -2302,4 +2302,4 @@ HugoTransactions::indexUpdateRecords(Ndb* pNdb,
return NDBT_OK;
}
-
+template class Vector<NDBT_ResultRow*>;