summaryrefslogtreecommitdiff
path: root/ndb/test/ndbapi/flexBench.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ndb/test/ndbapi/flexBench.cpp')
-rw-r--r--ndb/test/ndbapi/flexBench.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/ndb/test/ndbapi/flexBench.cpp b/ndb/test/ndbapi/flexBench.cpp
index cc2bfb391da..abddecfdc40 100644
--- a/ndb/test/ndbapi/flexBench.cpp
+++ b/ndb/test/ndbapi/flexBench.cpp
@@ -49,6 +49,7 @@ Arguments:
* *************************************************** */
+#include <ndb_global.h>
#include "NdbApi.hpp"
#include <NdbMain.h>
@@ -279,6 +280,8 @@ tellThreads(ThreadData* pt, StartType what)
pt[i].threadStart = what;
}
+static Ndb_cluster_connection *g_cluster_connection= 0;
+
NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
{
ndb_init();
@@ -326,8 +329,16 @@ NDB_COMMAND(flexBench, "flexBench", "flexBench", "flexbench", 65535)
NdbThread_SetConcurrencyLevel(tNoOfThreads + 2);
+ Ndb_cluster_connection con;
+ if(con.connect(12, 5, 1) != 0)
+ {
+ return NDBT_ProgramExit(NDBT_FAILED);
+ }
+
+ g_cluster_connection= &con;
+
Ndb* pNdb;
- pNdb = new Ndb( "TEST_DB" );
+ pNdb = new Ndb(&con, "TEST_DB" );
pNdb->init();
tNodeId = pNdb->getNodeId();
@@ -605,7 +616,7 @@ static void* flexBenchThread(void* pArg)
attrValue = (int*)malloc(nReadBuffSize) ;
attrRefValue = (int*)malloc(nRefBuffSize) ;
pOps = (NdbOperation**)malloc(tNoOfTables*sizeof(NdbOperation*)) ;
- pNdb = new Ndb( "TEST_DB" );
+ pNdb = new Ndb(g_cluster_connection, "TEST_DB" );
if(!attrValue || !attrRefValue || !pOps || !pNdb){
// Check allocations to make sure we got all the memory we asked for