summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorunknown <tnurnberg@sin.intern.azundris.com>2007-08-01 04:56:58 +0200
committerunknown <tnurnberg@sin.intern.azundris.com>2007-08-01 04:56:58 +0200
commitf5b95d0be141416c95a657d42ef39937d01c4c8e (patch)
tree23bd452937d47837b1c579fcd562a7ca6c208617 /ndb
parent28ec0efcb6810c98af5bfbeeaaf0bfa13343a874 (diff)
downloadmariadb-git-f5b95d0be141416c95a657d42ef39937d01c4c8e.tar.gz
Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2
mysqld hasn't been built on AIX with ndb-everything in quite a while. this allowed a variety of changes to be added that broke the AIX build for both the GNU and IBM compilers (but the IBM suite in particular). Changeset lets build to complete on AIX 5.2 for users of the GNU and the IBM suite both. Tudo bem? config/ac-macros/large_file.m4: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (2) we no longer declare anything large-file on AIX. the GNU C++ compiler declares _LARGE_FILE_API all of its own, and either way we're now pulling in <standards.h> when on AIX, which defines _LARGE_FILE_API (if not already defined). configure.in: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (1) build NDB binaries as static on AIX. because that actually *works*. when building dynamic, with the IBM compiler (xlC_r), and the build breaks on AIX due to missing symbols (__vec__delete2 et al.), try adding -lhC to the Makefile. include/mysql.h: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (2) we're now pulling in <standards.h> when on AIX, which defines _LARGE_FILE_API (if not already defined). ndb/src/common/util/File.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (3) do not de-scope the standards, for they may be funky macros ndb/src/mgmclient/Makefile.am: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (4) make IBM C++ compiler happy on AIX ndb/src/mgmsrv/Makefile.am: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (5) GNU compiler has no sense of humour about this ndb/test/ndbapi/benchronja.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (6) MAXTHREADS collides with a #define from <sys/thread.h> on AIX (IBM compiler). Call it NDB_MAXTHREADS instead. Also explicitly #undef it here lest someone use it by habit and get really funny results. (K&R says we may #undef non-existent symbols.) ndb/test/ndbapi/flexAsynch.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (6) MAXTHREADS collides with a #define from <sys/thread.h> on AIX (IBM compiler). Call it NDB_MAXTHREADS instead. Also explicitly #undef it here lest someone use it by habit and get really funny results. (K&R says we may #undef non-existent symbols.) ndb/test/ndbapi/flexHammer.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (6) MAXTHREADS collides with a #define from <sys/thread.h> on AIX (IBM compiler). Call it NDB_MAXTHREADS instead. Also explicitly #undef it here lest someone use it by habit and get really funny results. (K&R says we may #undef non-existent symbols.) ndb/test/ndbapi/flexScan.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (6) MAXTHREADS collides with a #define from <sys/thread.h> on AIX (IBM compiler). Call it NDB_MAXTHREADS instead. Also explicitly #undef it here lest someone use it by habit and get really funny results. (K&R says we may #undef non-existent symbols.) ndb/test/ndbapi/flexTT.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (6) MAXTHREADS collides with a #define from <sys/thread.h> on AIX (IBM compiler). Call it NDB_MAXTHREADS instead. Also explicitly #undef it here lest someone use it by habit and get really funny results. (K&R says we may #undef non-existent symbols.) ndb/test/ndbapi/flexTimedAsynch.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (6) MAXTHREADS collides with a #define from <sys/thread.h> on AIX (IBM compiler). Call it NDB_MAXTHREADS instead. Also explicitly #undef it here lest someone use it by habit and get really funny results. (K&R says we may #undef non-existent symbols.) ndb/test/ndbapi/initronja.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (6) MAXTHREADS collides with a #define from <sys/thread.h> on AIX (IBM compiler). Call it NDB_MAXTHREADS instead. Also explicitly #undef it here lest someone use it by habit and get really funny results. (K&R says we may #undef non-existent symbols.) ndb/test/ndbapi/testOperations.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (7) IBM C compiler on AIX is not happy with the re-def. ndb/test/ndbapi/testScanFilter.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (8) The IBM C++ compiler on AIX doesn't like initializing from pow(). This works, but breaks a VAL (bool res_cal[TUPLE_NUM] ...) later on. ndb/test/odbc/SQL99_test/SQL99_test.cpp: Bug #10776: Failure to compile ndb ReadNodesConf.cpp on AIX 5.2 (6) MAXTHREADS collides with a #define from <sys/thread.h> on AIX (IBM compiler). Call it NDB_MAXTHREADS instead. Also explicitly #undef it here lest someone use it by habit and get really funny results. (K&R says we may #undef non-existent symbols.)
Diffstat (limited to 'ndb')
-rw-r--r--ndb/src/common/util/File.cpp4
-rw-r--r--ndb/src/mgmclient/Makefile.am1
-rw-r--r--ndb/src/mgmsrv/Makefile.am2
-rw-r--r--ndb/test/ndbapi/benchronja.cpp19
-rw-r--r--ndb/test/ndbapi/flexAsynch.cpp19
-rw-r--r--ndb/test/ndbapi/flexHammer.cpp15
-rw-r--r--ndb/test/ndbapi/flexScan.cpp11
-rw-r--r--ndb/test/ndbapi/flexTT.cpp19
-rw-r--r--ndb/test/ndbapi/flexTimedAsynch.cpp23
-rw-r--r--ndb/test/ndbapi/initronja.cpp9
-rw-r--r--ndb/test/ndbapi/testOperations.cpp5
-rw-r--r--ndb/test/ndbapi/testScanFilter.cpp12
-rw-r--r--ndb/test/odbc/SQL99_test/SQL99_test.cpp13
13 files changed, 106 insertions, 46 deletions
diff --git a/ndb/src/common/util/File.cpp b/ndb/src/common/util/File.cpp
index a75fa5ae463..fe0fdfd1c91 100644
--- a/ndb/src/common/util/File.cpp
+++ b/ndb/src/common/util/File.cpp
@@ -50,7 +50,7 @@ File_class::size(FILE* f)
MY_STAT s;
// Note that my_fstat behaves *differently* than my_stat. ARGGGHH!
- if(my_fstat(::fileno(f), &s, MYF(0)))
+ if(my_fstat(fileno(f), &s, MYF(0)))
return 0;
return s.st_size;
@@ -196,7 +196,7 @@ File_class::flush() const
{
#if defined NDB_OSE || defined NDB_SOFTOSE
::fflush(m_file);
- return ::fsync(::fileno(m_file));
+ return ::fsync(fileno(m_file));
#else
return ::fflush(m_file);;
#endif
diff --git a/ndb/src/mgmclient/Makefile.am b/ndb/src/mgmclient/Makefile.am
index 99540160341..e1287532a07 100644
--- a/ndb/src/mgmclient/Makefile.am
+++ b/ndb/src/mgmclient/Makefile.am
@@ -36,6 +36,7 @@ INCLUDES += -I$(top_srcdir)/ndb/include/mgmapi \
LDADD_LOC = $(noinst_LTLIBRARIES) \
../common/portlib/libportlib.la \
@readline_link@ \
+ $(top_builddir)/ndb/src/libndbclient.la \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/strings/libmystrings.a \
diff --git a/ndb/src/mgmsrv/Makefile.am b/ndb/src/mgmsrv/Makefile.am
index 88622c08e53..3d1845957e6 100644
--- a/ndb/src/mgmsrv/Makefile.am
+++ b/ndb/src/mgmsrv/Makefile.am
@@ -38,7 +38,7 @@ INCLUDES_LOC = -I$(top_srcdir)/ndb/src/ndbapi \
-I$(top_srcdir)/ndb/src/common/mgmcommon \
-I$(top_srcdir)/ndb/src/mgmclient
-LDADD_LOC = $(top_builddir)/ndb/src/mgmclient/CommandInterpreter.o \
+LDADD_LOC = $(top_builddir)/ndb/src/mgmclient/CommandInterpreter.lo \
$(top_builddir)/ndb/src/libndbclient.la \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/mysys/libmysys.a \
diff --git a/ndb/test/ndbapi/benchronja.cpp b/ndb/test/ndbapi/benchronja.cpp
index 4973e6e2487..73ee324a888 100644
--- a/ndb/test/ndbapi/benchronja.cpp
+++ b/ndb/test/ndbapi/benchronja.cpp
@@ -41,7 +41,14 @@
#define MAXSTRLEN 16
#define MAXATTR 64
#define MAXTABLES 64
-#define MAXTHREADS 256
+#define NDB_MAXTHREADS 256
+/*
+ NDB_MAXTHREADS used to be just MAXTHREADS, which collides with a
+ #define from <sys/thread.h> on AIX (IBM compiler). We explicitly
+ #undef it here lest someone use it by habit and get really funny
+ results. K&R says we may #undef non-existent symbols, so let's go.
+*/
+#undef MAXTHREADS
#define MAXATTRSIZE 8000
#define START_TIMER NdbTimer timer; timer.doStart();
#define STOP_TIMER timer.doStop();
@@ -56,18 +63,18 @@ struct ThreadNdb
Ndb* NdbRef;
};
-static NdbThread* threadLife[MAXTHREADS];
+static NdbThread* threadLife[NDB_MAXTHREADS];
static unsigned int tNoOfThreads;
static unsigned int tNoOfOpsPerExecute;
static unsigned int tNoOfRecords;
static unsigned int tNoOfOperations;
-static int ThreadReady[MAXTHREADS];
-static int ThreadStart[MAXTHREADS];
+static int ThreadReady[NDB_MAXTHREADS];
+static int ThreadStart[NDB_MAXTHREADS];
NDB_COMMAND(benchronja, "benchronja", "benchronja", "benchronja", 65535){
ndb_init();
- ThreadNdb tabThread[MAXTHREADS];
+ ThreadNdb tabThread[NDB_MAXTHREADS];
int i = 0 ;
int cont = 0 ;
Ndb* pMyNdb = NULL ; //( "TEST_DB" );
@@ -84,7 +91,7 @@ NDB_COMMAND(benchronja, "benchronja", "benchronja", "benchronja", 65535){
{
if (strcmp(argv[i], "-t") == 0){
tNoOfThreads = atoi(argv[i+1]);
- if ((tNoOfThreads < 1) || (tNoOfThreads > MAXTHREADS)) goto error_input;
+ if ((tNoOfThreads < 1) || (tNoOfThreads > NDB_MAXTHREADS)) goto error_input;
}else if (strcmp(argv[i], "-o") == 0){
tNoOfOperations = atoi(argv[i+1]);
if (tNoOfOperations < 1) goto error_input;
diff --git a/ndb/test/ndbapi/flexAsynch.cpp b/ndb/test/ndbapi/flexAsynch.cpp
index 20a157fc2f3..1f52315482f 100644
--- a/ndb/test/ndbapi/flexAsynch.cpp
+++ b/ndb/test/ndbapi/flexAsynch.cpp
@@ -35,7 +35,14 @@
#define MAXSTRLEN 16
#define MAXATTR 64
#define MAXTABLES 64
-#define MAXTHREADS 128
+#define NDB_MAXTHREADS 128
+/*
+ NDB_MAXTHREADS used to be just MAXTHREADS, which collides with a
+ #define from <sys/thread.h> on AIX (IBM compiler). We explicitly
+ #undef it here lest someone use it by habit and get really funny
+ results. K&R says we may #undef non-existent symbols, so let's go.
+*/
+#undef MAXTHREADS
#define MAXPAR 1024
#define MAXATTRSIZE 1000
#define PKSIZE 2
@@ -76,10 +83,10 @@ struct ThreadNdb
int ThreadNo;
};
-static NdbThread* threadLife[MAXTHREADS];
+static NdbThread* threadLife[NDB_MAXTHREADS];
static int tNodeId;
-static int ThreadReady[MAXTHREADS];
-static StartType ThreadStart[MAXTHREADS];
+static int ThreadReady[NDB_MAXTHREADS];
+static StartType ThreadStart[NDB_MAXTHREADS];
static char tableName[MAXTABLES][MAXSTRLEN+1];
static char attrName[MAXATTR][MAXSTRLEN+1];
@@ -160,7 +167,7 @@ NDB_COMMAND(flexAsynch, "flexAsynch", "flexAsynch", "flexAsynch", 65535)
return NDBT_ProgramExit(NDBT_WRONGARGS);
}
- pThreadData = new ThreadNdb[MAXTHREADS];
+ pThreadData = new ThreadNdb[NDB_MAXTHREADS];
ndbout << endl << "FLEXASYNCH - Starting normal mode" << endl;
ndbout << "Perform benchmark of insert, update and delete transactions";
@@ -844,7 +851,7 @@ readArguments(int argc, const char** argv){
while (argc > 1){
if (strcmp(argv[i], "-t") == 0){
tNoOfThreads = atoi(argv[i+1]);
- if ((tNoOfThreads < 1) || (tNoOfThreads > MAXTHREADS)){
+ if ((tNoOfThreads < 1) || (tNoOfThreads > NDB_MAXTHREADS)){
ndbout_c("Invalid no of threads");
return -1;
}
diff --git a/ndb/test/ndbapi/flexHammer.cpp b/ndb/test/ndbapi/flexHammer.cpp
index 9abac905f5a..3847bc38b35 100644
--- a/ndb/test/ndbapi/flexHammer.cpp
+++ b/ndb/test/ndbapi/flexHammer.cpp
@@ -69,7 +69,14 @@ ErrorData * flexHammerErrorData;
#define MAXSTRLEN 16
#define MAXATTR 64
#define MAXTABLES 64
-#define MAXTHREADS 256
+#define NDB_MAXTHREADS 256
+/*
+ NDB_MAXTHREADS used to be just MAXTHREADS, which collides with a
+ #define from <sys/thread.h> on AIX (IBM compiler). We explicitly
+ #undef it here lest someone use it by habit and get really funny
+ results. K&R says we may #undef non-existent symbols, so let's go.
+*/
+#undef MAXTHREADS
#define MAXATTRSIZE 100
// Max number of retries if something fails
#define MaxNoOfAttemptsC 10
@@ -122,8 +129,8 @@ static int tAttributeSize;
static int tNoOfOperations;
static int tNoOfRecords;
static int tNoOfLoops;
-static ReadyType ThreadReady[MAXTHREADS];
-static StartType ThreadStart[MAXTHREADS];
+static ReadyType ThreadReady[NDB_MAXTHREADS];
+static StartType ThreadStart[NDB_MAXTHREADS];
static char tableName[MAXTABLES][MAXSTRLEN];
static char attrName[MAXATTR][MAXSTRLEN];
static int theSimpleFlag = 0;
@@ -643,7 +650,7 @@ readArguments (int argc, const char** argv)
while (argc > 1) {
if (strcmp(argv[i], "-t") == 0) {
tNoOfThreads = atoi(argv[i+1]);
- if ((tNoOfThreads < 1) || (tNoOfThreads > MAXTHREADS))
+ if ((tNoOfThreads < 1) || (tNoOfThreads > NDB_MAXTHREADS))
return(1);
}
else if (strcmp(argv[i], "-o") == 0) {
diff --git a/ndb/test/ndbapi/flexScan.cpp b/ndb/test/ndbapi/flexScan.cpp
index cbea90f44f4..4e3def7fb91 100644
--- a/ndb/test/ndbapi/flexScan.cpp
+++ b/ndb/test/ndbapi/flexScan.cpp
@@ -68,7 +68,14 @@
#define MAXSTRLEN 16
#define MAXATTR 64
#define MAXTABLES 64
-#define MAXTHREADS 256
+#define NDB_MAXTHREADS 256
+/*
+ NDB_MAXTHREADS used to be just MAXTHREADS, which collides with a
+ #define from <sys/thread.h> on AIX (IBM compiler). We explicitly
+ #undef it here lest someone use it by habit and get really funny
+ results. K&R says we may #undef non-existent symbols, so let's go.
+*/
+#undef MAXTHREADS
#define MAXATTRSIZE 64
enum StartType {
@@ -860,7 +867,7 @@ static int readArguments(int argc, const char** argv)
if (strcmp(argv[i], "-t") == 0) {
if (argv[i + 1] != NULL) {
tNoOfThreads = atoi(argv[i + 1]);
- if ((tNoOfThreads < 1) || (tNoOfThreads > MAXTHREADS)) {
+ if ((tNoOfThreads < 1) || (tNoOfThreads > NDB_MAXTHREADS)) {
retValue = -1;
} // if
} // if
diff --git a/ndb/test/ndbapi/flexTT.cpp b/ndb/test/ndbapi/flexTT.cpp
index 71d5b6c096e..4373102f77e 100644
--- a/ndb/test/ndbapi/flexTT.cpp
+++ b/ndb/test/ndbapi/flexTT.cpp
@@ -35,7 +35,14 @@
#define MAXSTRLEN 16
#define MAXATTR 64
#define MAXTABLES 64
-#define MAXTHREADS 128
+#define NDB_MAXTHREADS 128
+/*
+ NDB_MAXTHREADS used to be just MAXTHREADS, which collides with a
+ #define from <sys/thread.h> on AIX (IBM compiler). We explicitly
+ #undef it here lest someone use it by habit and get really funny
+ results. K&R says we may #undef non-existent symbols, so let's go.
+*/
+#undef MAXTHREADS
#define MAXPAR 1024
#define MAXATTRSIZE 1000
#define PKSIZE 1
@@ -101,10 +108,10 @@ static void input_error();
ErrorData * flexTTErrorData;
-static NdbThread* threadLife[MAXTHREADS];
+static NdbThread* threadLife[NDB_MAXTHREADS];
static int tNodeId;
-static int ThreadReady[MAXTHREADS];
-static StartType ThreadStart[MAXTHREADS];
+static int ThreadReady[NDB_MAXTHREADS];
+static StartType ThreadStart[NDB_MAXTHREADS];
static char tableName[1][MAXSTRLEN+1];
static char attrName[5][MAXSTRLEN+1];
@@ -184,7 +191,7 @@ NDB_COMMAND(flexTT, "flexTT", "flexTT", "flexTT", 65535)
return NDBT_ProgramExit(NDBT_WRONGARGS);
}
- pThreadData = new ThreadNdb[MAXTHREADS];
+ pThreadData = new ThreadNdb[NDB_MAXTHREADS];
ndbout << endl << "FLEXTT - Starting normal mode" << endl;
ndbout << "Perform TimesTen benchmark" << endl;
@@ -798,7 +805,7 @@ readArguments(int argc, const char** argv){
while (argc > 1){
if (strcmp(argv[i], "-t") == 0){
tNoOfThreads = atoi(argv[i+1]);
- if ((tNoOfThreads < 1) || (tNoOfThreads > MAXTHREADS)){
+ if ((tNoOfThreads < 1) || (tNoOfThreads > NDB_MAXTHREADS)){
ndbout_c("Invalid no of threads");
return -1;
}
diff --git a/ndb/test/ndbapi/flexTimedAsynch.cpp b/ndb/test/ndbapi/flexTimedAsynch.cpp
index cc44ab8b237..b6301e59df2 100644
--- a/ndb/test/ndbapi/flexTimedAsynch.cpp
+++ b/ndb/test/ndbapi/flexTimedAsynch.cpp
@@ -57,7 +57,14 @@
#define MAXSTRLEN 16
#define MAXATTR 64
#define MAXTABLES 64
-#define MAXTHREADS 256
+#define NDB_MAXTHREADS 256
+/*
+ NDB_MAXTHREADS used to be just MAXTHREADS, which collides with a
+ #define from <sys/thread.h> on AIX (IBM compiler). We explicitly
+ #undef it here lest someone use it by habit and get really funny
+ results. K&R says we may #undef non-existent symbols, so let's go.
+*/
+#undef MAXTHREADS
#define MAXATTRSIZE 1000
#define PKSIZE 1
@@ -95,10 +102,10 @@ static int failed = 0 ; // lame global variable that keeps track of failed trans
// incremented in executeCallback() and reset in main()
/************************************************************* < epaulsa */
-static NdbThread* threadLife[MAXTHREADS];
+static NdbThread* threadLife[NDB_MAXTHREADS];
static int tNodeId;
-static int ThreadReady[MAXTHREADS];
-static StartType ThreadStart[MAXTHREADS];
+static int ThreadReady[NDB_MAXTHREADS];
+static StartType ThreadStart[NDB_MAXTHREADS];
static char tableName[MAXTABLES][MAXSTRLEN+1];
static char attrName[MAXATTR][MAXSTRLEN+1];
static int *getAttrValueTable;
@@ -174,7 +181,7 @@ void deleteAttributeSpace(){
NDB_COMMAND(flexTimedAsynch, "flexTimedAsynch", "flexTimedAsynch [-tpoilcas]", "flexTimedAsynch", 65535)
{
ndb_init();
- ThreadNdb tabThread[MAXTHREADS];
+ ThreadNdb tabThread[NDB_MAXTHREADS];
int tLoops=0;
int returnValue;
//NdbOut flexTimedAsynchNdbOut;
@@ -615,8 +622,8 @@ void readArguments(int argc, const char** argv)
if (strcmp(argv[i], "-t") == 0)
{
tNoOfThreads = atoi(argv[i+1]);
- // if ((tNoOfThreads < 1) || (tNoOfThreads > MAXTHREADS))
- if ((tNoOfThreads < 1) || (tNoOfThreads > MAXTHREADS))
+ // if ((tNoOfThreads < 1) || (tNoOfThreads > NDB_MAXTHREADS))
+ if ((tNoOfThreads < 1) || (tNoOfThreads > NDB_MAXTHREADS))
exit(-1);
}
else if (strcmp(argv[i], "-i") == 0)
@@ -628,7 +635,7 @@ void readArguments(int argc, const char** argv)
else if (strcmp(argv[i], "-p") == 0)
{
tNoOfTransInBatch = atoi(argv[i+1]);
- //if ((tNoOfTransInBatch < 1) || (tNoOfTransInBatch > MAXTHREADS))
+ //if ((tNoOfTransInBatch < 1) || (tNoOfTransInBatch > NDB_MAXTHREADS))
if ((tNoOfTransInBatch < 1) || (tNoOfTransInBatch > 10000))
exit(-1);
}
diff --git a/ndb/test/ndbapi/initronja.cpp b/ndb/test/ndbapi/initronja.cpp
index 63bbc374c62..f48b1c86da3 100644
--- a/ndb/test/ndbapi/initronja.cpp
+++ b/ndb/test/ndbapi/initronja.cpp
@@ -29,7 +29,14 @@
#define MAXSTRLEN 16
#define MAXATTR 64
#define MAXTABLES 64
-#define MAXTHREADS 256
+#define NDB_MAXTHREADS 256
+/*
+ NDB_MAXTHREADS used to be just MAXTHREADS, which collides with a
+ #define from <sys/thread.h> on AIX (IBM compiler). We explicitly
+ #undef it here lest someone use it by habit and get really funny
+ results. K&R says we may #undef non-existent symbols, so let's go.
+*/
+#undef MAXTHREADS
#define MAXATTRSIZE 8000
static unsigned int tNoOfRecords;
diff --git a/ndb/test/ndbapi/testOperations.cpp b/ndb/test/ndbapi/testOperations.cpp
index 1f610cade4a..21151ab5c7f 100644
--- a/ndb/test/ndbapi/testOperations.cpp
+++ b/ndb/test/ndbapi/testOperations.cpp
@@ -98,11 +98,6 @@ OperationTestCase matrix[] = {
break; }
#define C3(b) if (!(b)) { \
- g_err << "ERR: "<< step->getName() \
- << " failed on line " << __LINE__ << endl; \
- abort(); return NDBT_FAILED; }
-
-#define C3(b) if (!(b)) { \
g_err << "ERR: failed on line " << __LINE__ << endl; \
return NDBT_FAILED; }
diff --git a/ndb/test/ndbapi/testScanFilter.cpp b/ndb/test/ndbapi/testScanFilter.cpp
index 5098d83745b..81aa6b82fa0 100644
--- a/ndb/test/ndbapi/testScanFilter.cpp
+++ b/ndb/test/ndbapi/testScanFilter.cpp
@@ -49,7 +49,15 @@ const char COL_LEN = 7;
* there are six columns, 'i', 'j', 'k', 'l', 'm', 'n', and each on is equal to 1 or 1,
* Since each tuple should be unique in this case, then TUPLE_NUM = 2 power 6 = 64
*/
-const int TUPLE_NUM = (int)pow(2, COL_LEN-1);
+#ifdef _AIX
+/*
+ IBM xlC_r breaks on the initialization with pow():
+ "The expression must be an integral constant expression."
+*/
+const int TUPLE_NUM = 64;
+#else
+const int TUPLE_NUM = (int)pow(2, COL_LEN-1);
+#endif
/*
* the recursive level of random scan filter, can
@@ -479,7 +487,7 @@ int get_column_id(char ch)
*/
bool check_col_equal_one(int tuple_no, int col_id)
{
- int i = (int)pow(2, 6 - col_id);
+ int i = (int)pow((double)2, (double)(6 - col_id));
int j = tuple_no / i;
if(j % 2)
return true;
diff --git a/ndb/test/odbc/SQL99_test/SQL99_test.cpp b/ndb/test/odbc/SQL99_test/SQL99_test.cpp
index 039a77f4d53..fb77220773d 100644
--- a/ndb/test/odbc/SQL99_test/SQL99_test.cpp
+++ b/ndb/test/odbc/SQL99_test/SQL99_test.cpp
@@ -27,7 +27,14 @@ using namespace std; //
#define MAXROW 64
#define DEFROW 8
-#define MAXTHREADS 24
+/*
+ NDB_MAXTHREADS used to be just MAXTHREADS, which collides with a
+ #define from <sys/thread.h> on AIX (IBM compiler). We explicitly
+ #undef it here lest someone use it by habit and get really funny
+ results. K&R says we may #undef non-existent symbols, so let's go.
+*/
+#undef MAXTHREADS
+#define NDB_MAXTHREADS 24
#define DEFTHREADS 2
#define MAXTABLES 16
@@ -83,7 +90,7 @@ int main(int argc, char* argv[]){
char* szTableNames = (char*)malloc(sizeof(char)*nNoOfTables*MAX_TABLE_NAME) ;
memset(szTableNames, 0, sizeof(char)*nNoOfTables*MAX_TABLE_NAME) ;
- UintPtr pThreadHandles[MAXTHREADS] = { NULL } ;
+ UintPtr pThreadHandles[NDB_MAXTHREADS] = { NULL } ;
AssignTableNames(szTableNames, nNoOfTables) ;
@@ -313,7 +320,7 @@ void ParseArguments(int argc, const char** argv){
if (strcmp(argv[i], "-t") == 0)
{
nNoOfThreads = atoi(argv[i+1]);
- if ((nNoOfThreads < 1) || (nNoOfThreads > MAXTHREADS))
+ if ((nNoOfThreads < 1) || (nNoOfThreads > NDB_MAXTHREADS))
nNoOfThreads = DEFTHREADS ;
}
else if (strcmp(argv[i], "-c") == 0)