Commit 2f182b3e authored by unknown's avatar unknown
Browse files

compile fix for ndbapi test program on irix (variable scope)


ndb/test/include/NDBT_Test.hpp:
  compile fix for ndbapi test program on irix
ndb/test/ndbapi/ScanFunctions.hpp:
  compile fix for ndbapi test program on irix
ndb/test/ndbapi/testDataBuffers.cpp:
  compile fix for ndbapi test program on irix
ndb/test/ndbapi/testDeadlock.cpp:
  compile fix for ndbapi test program on irix
ndb/test/ndbapi/testDict.cpp:
  compile fix for ndbapi test program on irix
ndb/test/ndbapi/testIndex.cpp:
  compile fix for ndbapi test program on irix
ndb/test/ndbapi/testLcp.cpp:
  compile fix for ndbapi test program on irix
ndb/test/ndbapi/testNdbApi.cpp:
  compile fix for ndbapi test program on irix
ndb/test/ndbapi/testOIBasic.cpp:
  compile fix for ndbapi test program on irix
ndb/test/ndbapi/testReadPerf.cpp:
  compile fix for ndbapi test program on irix
ndb/test/ndbapi/testRestartGci.cpp:
  compile fix for ndbapi test program on irix
ndb/test/ndbapi/testScanPerf.cpp:
  compile fix for ndbapi test program on irix
ndb/test/ndbapi/testSystemRestart.cpp:
  compile fix for ndbapi test program on irix
parent 70663052
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -392,10 +392,10 @@ C##suitname():NDBT_TestSuite(#suitname){ \

// Add a number of equal steps to the testcase
#define STEPS(stepfunc, num) \
  for (int i = 0; i < num; i++){ \
  { int i; for (i = 0; i < num; i++){ \
    pts = new NDBT_ParallelStep(pt, #stepfunc, stepfunc); \
    pt->addStep(pts);\
  }
  } }

#define VERIFIER(stepfunc) \
  ptv = new NDBT_Verifier(pt, #stepfunc, stepfunc); \
+10 −10
Original line number Diff line number Diff line
@@ -286,36 +286,36 @@ void AttribList::buildAttribList(const NdbDictionary::Table* pTab){
  attr = new Attrib;
  attr->numAttribs = 0;
  attriblist.push_back(attr);

  for(int i = 1; i < pTab->getNoOfColumns(); i++){
  int i;
  for(i = 1; i < pTab->getNoOfColumns(); i++){
    attr = new Attrib;
    attr->numAttribs = i;
    for(int a = 0; a<i; a++)
      attr->attribs[a] = a;
    attriblist.push_back(attr);
  }
  for(int i = pTab->getNoOfColumns()-1; i > 0; i--){
  for(i = pTab->getNoOfColumns()-1; i > 0; i--){
    attr = new Attrib;
    attr->numAttribs = i;
    for(int a = 0; a<i; a++)
      attr->attribs[a] = a;
    attriblist.push_back(attr);
  }
  for(int i = pTab->getNoOfColumns(); i > 0;  i--){
  for(i = pTab->getNoOfColumns(); i > 0;  i--){
    attr = new Attrib;
    attr->numAttribs = pTab->getNoOfColumns() - i;
    for(int a = 0; a<pTab->getNoOfColumns() - i; a++)
      attr->attribs[a] = pTab->getNoOfColumns()-a-1;
    attriblist.push_back(attr); 
  }  
  for(int i = 1; i < pTab->getNoOfColumns(); i++){
  for(i = 1; i < pTab->getNoOfColumns(); i++){
    attr = new Attrib;
    attr->numAttribs = pTab->getNoOfColumns() - i;
    for(int a = 0; a<pTab->getNoOfColumns() - i; a++)
      attr->attribs[a] = pTab->getNoOfColumns()-a-1;
    attriblist.push_back(attr); 
  }  
  for(int i = 1; i < pTab->getNoOfColumns(); i++){
  for(i = 1; i < pTab->getNoOfColumns(); i++){
    attr = new Attrib;
    attr->numAttribs = 2;
    for(int a = 0; a<2; a++){
@@ -345,11 +345,11 @@ void AttribList::buildAttribList(const NdbDictionary::Table* pTab){
  attriblist.push_back(attr);  

#if 1
  for(size_t i = 0; i < attriblist.size(); i++){
  for(size_t j = 0; j < attriblist.size(); j++){

    g_info << attriblist[i]->numAttribs << ": " ;
    for(int a = 0; a < attriblist[i]->numAttribs; a++)
      g_info << attriblist[i]->attribs[a] << ", ";
    g_info << attriblist[j]->numAttribs << ": " ;
    for(int a = 0; a < attriblist[j]->numAttribs; a++)
      g_info << attriblist[j]->attribs[a] << ", ";
    g_info << endl;
  }
#endif
+27 −23
Original line number Diff line number Diff line
@@ -123,15 +123,15 @@ chkerror(char const* fmt, ...)

// alignment of addresses and data sizes

static bool isAligned(unsigned x)
static bool isAligned(UintPtr x)
{
    return ((x & 3) == 0);
}
static bool isAligned(char* p)
{
    return isAligned(unsigned(p));
    return isAligned(UintPtr(p));
}
static unsigned toAligned(unsigned x)
static unsigned toAligned(UintPtr x)
{
    while (! isAligned(x))
	x++;
@@ -223,10 +223,10 @@ testcase(int flag)
    noRandom = ! (flag & 8);
    ndbout << (noRandom ? "simple sizes" : "randomize sizes") << endl;

    int smax = 0, stot = 0;
    int smax = 0, stot = 0, i;
    if (xverbose)
      ndbout << "- define table " << tab << endl;
    for (int i = 0; i < attrcnt; i++) {
    for (i = 0; i < attrcnt; i++) {
	col& c = ccol[i];
	memset(&c, 0, sizeof(c));
	sprintf(c.aAttrName, "C%d", i);
@@ -266,7 +266,7 @@ testcase(int flag)
	return ndberror("getNdbSchemaOp");
    if (top->createTable(tab) < 0)
	return ndberror("createTable");
    for (int i = 0; i < attrcnt; i++) {
    for (i = 0; i < attrcnt; i++) {
	col& c = ccol[i];
	if (top->createAttribute(
	    c.aAttrName,
@@ -299,7 +299,7 @@ testcase(int flag)
	    return ndberror("getNdbOperation key=%d", key);
	if (op->deleteTuple() < 0)
	    return ndberror("deleteTuple key=%d", key);
	for (int i = 0; i < attrcnt; i++) {
	for (i = 0; i < attrcnt; i++) {
	    col& c = ccol[i];
	    if (i == 0) {
		if (op->equal(c.aAttrName, (char*)&key, sizeof(key)) < 0)
@@ -329,7 +329,7 @@ testcase(int flag)
	    return ndberror("getNdbOperation key=%d", key);
	if (op->insertTuple() < 0)
	    return ndberror("insertTuple key=%d", key);
	for (int i = 0; i < attrcnt; i++) {
	for (i = 0; i < attrcnt; i++) {
	    col& c = ccol[i];
	    if (i == 0) {
		if (op->equal(c.aAttrName, (char*)&key, sizeof(key)) < 0)
@@ -362,7 +362,7 @@ testcase(int flag)
	    return ndberror("getNdbOperation key=%d", key);
	if (op->readTuple() < 0)
	    return ndberror("readTuple key=%d", key);
	for (int i = 0; i < attrcnt; i++) {
	for (i = 0; i < attrcnt; i++) {
	    col& c = ccol[i];
	    if (i == 0) {
		if (op->equal(c.aAttrName, (char*)&key, sizeof(key)) < 0)
@@ -371,7 +371,7 @@ testcase(int flag)
		if (xverbose) {
		  char tmp[20];
		  if (useBuf)
		    sprintf(tmp, "0x%x", int(c.buf + off));
		    sprintf(tmp, "0x%p", c.buf + off);
		  else
		    strcpy(tmp, "ndbapi");
		  ndbout << "--- column " << i << " addr=" << tmp << endl;
@@ -388,23 +388,24 @@ testcase(int flag)
	}
	if (con->execute(Commit) != 0)
	    return ndberror("execute key=%d", key);
	for (int i = 0; i < attrcnt; i++) {
	for (i = 0; i < attrcnt; i++) {
	    col& c = ccol[i];
	    if (i == 0) {
	    } else if (useBuf) {
		for (int j = 0; j < off; j++) {
                int j;
		for (j = 0; j < off; j++) {
		    if (c.buf[j] != 'B') {
			return chkerror("mismatch before key=%d col=%d pos=%d ok=%02x bad=%02x",
			    key, i, j, 'B', c.buf[j]);
		    }
		}
		for (int j = 0; j < c.aArraySize; j++) {
		for (j = 0; j < c.aArraySize; j++) {
		    if (c.buf[j + off] != byteVal(key, i, j)) {
			return chkerror("mismatch key=%d col=%d pos=%d ok=%02x bad=%02x",
			    key, i, j, byteVal(key, i, j), c.buf[j]);
		    }
		}
		for (int j = c.aArraySize + off; j < c.bufsiz; j++) {
		for (j = c.aArraySize + off; j < c.bufsiz; j++) {
		    if (c.buf[j] != 'B') {
			return chkerror("mismatch after key=%d col=%d pos=%d ok=%02x bad=%02x",
			    key, i, j, 'B', c.buf[j]);
@@ -431,7 +432,8 @@ testcase(int flag)
    if (xverbose)
      ndbout << "- scan" << endl;
    char found[MaxOper];
    for (int k = 0; k < opercnt; k++)
    int k;
    for (k = 0; k < opercnt; k++)
	found[k] = 0;
    for (key = 0; key < opercnt; key++) {
	int off = makeOff(key);
@@ -459,7 +461,7 @@ testcase(int flag)
	    if (op->interpret_exit_ok() < 0)
		return ndberror("interpret_exit_ok");
	}
	for (int i = 0; i < attrcnt; i++) {
	for (i = 0; i < attrcnt; i++) {
	    col& c = ccol[i];
	    if (i == 0) {
		if (op->getValue(c.aAttrName, (char*)&newkey) < 0)
@@ -468,7 +470,7 @@ testcase(int flag)
		if (xverbose) {
		  char tmp[20];
		  if (useBuf)
		    sprintf(tmp, "0x%x", int(c.buf + off));
		    sprintf(tmp, "0x%p", c.buf + off);
		  else
		    strcpy(tmp, "ndbapi");
		  ndbout << "--- column " << i << " addr=" << tmp << endl;
@@ -489,22 +491,23 @@ testcase(int flag)
	while ((ret = rs->nextResult()) == 0) {
	    if (key != newkey)
		return ndberror("unexpected key=%d newkey=%d", key, newkey);
	    for (int i = 1; i < attrcnt; i++) {
	    for (i = 1; i < attrcnt; i++) {
		col& c = ccol[i];
		if (useBuf) {
		    for (int j = 0; j < off; j++) {
                    int j;
		    for (j = 0; j < off; j++) {
			if (c.buf[j] != 'C') {
			    return chkerror("mismatch before key=%d col=%d pos=%d ok=%02x bad=%02x",
				key, i, j, 'C', c.buf[j]);
			}
		    }
		    for (int j = 0; j < c.aArraySize; j++) {
		    for (j = 0; j < c.aArraySize; j++) {
			if (c.buf[j + off] != byteVal(key, i, j)) {
			    return chkerror("mismatch key=%d col=%d pos=%d ok=%02x bad=%02x",
				key, i, j, byteVal(key, i, j), c.buf[j]);
			}
		    }
		    for (int j = c.aArraySize + off; j < c.bufsiz; j++) {
		    for (j = c.aArraySize + off; j < c.bufsiz; j++) {
			if (c.buf[j] != 'C') {
			    return chkerror("mismatch after key=%d col=%d pos=%d ok=%02x bad=%02x",
				key, i, j, 'C', c.buf[j]);
@@ -533,7 +536,7 @@ testcase(int flag)
    }
    con = 0;
    op = 0;
    for (int k = 0; k < opercnt; k++)
    for (k = 0; k < opercnt; k++)
	if (! found[k])
	    return ndberror("key %d not found", k);
    ndbout << "scanned " << key << endl;
@@ -545,6 +548,7 @@ testcase(int flag)

NDB_COMMAND(testDataBuffers, "testDataBuffers", "testDataBuffers", "testDataBuffers", 65535)
{
    int i;
    ndb_init();
    while (++argv, --argc > 0) {
	char const* p = argv[0];
@@ -602,7 +606,7 @@ NDB_COMMAND(testDataBuffers, "testDataBuffers", "testDataBuffers", "testDataBuff
	}
    }
    unsigned ok = true;
    for (int i = 1; 0 == loopcnt || i <= loopcnt; i++) {
    for (i = 1; 0 == loopcnt || i <= loopcnt; i++) {
	ndbout << "=== loop " << i << " ===" << endl;
	for (int flag = 0; flag < (1<<testbits); flag++) {
	    if (testcase(flag) < 0) {
+4 −3
Original line number Diff line number Diff line
@@ -459,7 +459,8 @@ wl1822_main(char scantx)
  static const unsigned thrcount = 2;
  // create threads for tx1 and tx2
  Thr* thrlist[2];
  for (int n = 0; n < thrcount; n++) {
  int n;
  for (n = 0; n < thrcount; n++) {
    Thr& thr = *(thrlist[n] = new Thr(1 + n));
    CHK(thr.m_ret == 0);
  }
@@ -472,7 +473,7 @@ wl1822_main(char scantx)
      if (runstep != 0)
        thr.start(runstep);
    }
    for (int n = 0; n < thrcount; n++) {
    for (n = 0; n < thrcount; n++) {
      Thr& thr = *thrlist[n];
      Runstep runstep = wl1822_step[i][n];
      if (runstep != 0)
@@ -480,7 +481,7 @@ wl1822_main(char scantx)
    }
  }
  // delete threads
  for (int n = 0; n < thrcount; n++) {
  for (n = 0; n < thrcount; n++) {
    Thr& thr = *thrlist[n];
    thr.exit();
    thr.join();
+3 −2
Original line number Diff line number Diff line
@@ -1431,11 +1431,12 @@ int
runTestDictionaryPerf(NDBT_Context* ctx, NDBT_Step* step){
  Vector<char*> cols;
  Vector<const NdbDictionary::Table*> tabs;
  int i;

  Ndb* pNdb = GETNDB(step);  

  const Uint32 count = NDBT_Tables::getNumTables();
  for (int i=0; i < count; i++){
  for (i=0; i < count; i++){
    const NdbDictionary::Table * tab = NDBT_Tables::getTable(i);
    pNdb->getDictionary()->createTable(* tab);
    
@@ -1458,7 +1459,7 @@ runTestDictionaryPerf(NDBT_Context* ctx, NDBT_Step* step){
  Uint32 size = cols.size() / 2;
  char ** columns = &cols[0];
  Uint64 start = NdbTick_CurrentMillisecond();
  for(int i = 0; i<times; i++){
  for(i = 0; i<times; i++){
    int j = 2 * (rand() % size);
    const NdbDictionary::Table* tab = (const NdbDictionary::Table*)tcols[j];
    const char * col = tcols[j+1];
Loading