summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
Diffstat (limited to 'ndb')
-rw-r--r--ndb/src/ndbapi/NdbConnection.cpp7
-rw-r--r--ndb/src/ndbapi/NdbOperationDefine.cpp4
-rw-r--r--ndb/src/ndbapi/Ndbinit.cpp21
-rw-r--r--ndb/test/ndbapi/testBlobs.cpp10
-rw-r--r--ndb/test/ndbapi/testOIBasic.cpp11
-rw-r--r--ndb/test/run-test/main.cpp1
6 files changed, 35 insertions, 19 deletions
diff --git a/ndb/src/ndbapi/NdbConnection.cpp b/ndb/src/ndbapi/NdbConnection.cpp
index e2a1b6d6ab9..0a1c7303771 100644
--- a/ndb/src/ndbapi/NdbConnection.cpp
+++ b/ndb/src/ndbapi/NdbConnection.cpp
@@ -361,11 +361,10 @@ NdbConnection::execute(ExecType aTypeOfExec,
if (executeNoBlobs(tExecType, abortOption, forceSend) == -1)
ret = -1;
-#ifndef VM_TRACE
- // can happen in complex abort cases
- theFirstOpInList = theLastOpInList = NULL;
-#else
+#ifdef ndb_api_crash_on_complex_blob_abort
assert(theFirstOpInList == NULL && theLastOpInList == NULL);
+#else
+ theFirstOpInList = theLastOpInList = NULL;
#endif
{
diff --git a/ndb/src/ndbapi/NdbOperationDefine.cpp b/ndb/src/ndbapi/NdbOperationDefine.cpp
index 35abb15b00d..c4aaffb3119 100644
--- a/ndb/src/ndbapi/NdbOperationDefine.cpp
+++ b/ndb/src/ndbapi/NdbOperationDefine.cpp
@@ -528,7 +528,9 @@ NdbOperation::setValue( const NdbColumnImpl* tAttrInfo,
CHARSET_INFO* cs = tAttrInfo->m_cs;
// invalid data can crash kernel
if (cs != NULL &&
- (*cs->cset->well_formed_len)(cs,
+ // fast fix bug#7340
+ tAttrInfo->m_type != NdbDictionary::Column::Text &&
+ (*cs->cset->well_formed_len)(cs,
aValue,
aValue + sizeInBytes,
sizeInBytes) != sizeInBytes) {
diff --git a/ndb/src/ndbapi/Ndbinit.cpp b/ndb/src/ndbapi/Ndbinit.cpp
index e1af7bd4cc5..a11dd842495 100644
--- a/ndb/src/ndbapi/Ndbinit.cpp
+++ b/ndb/src/ndbapi/Ndbinit.cpp
@@ -204,14 +204,6 @@ Ndb::~Ndb()
TransporterFacade::instance()->close(theNdbBlockNumber, theFirstTransId);
}
- if (global_ndb_cluster_connection != 0) {
- theNoOfNdbObjects--;
- if(theNoOfNdbObjects == 0){
- delete global_ndb_cluster_connection;
- global_ndb_cluster_connection= 0;
- }
- }//if
-
// if (theSchemaConToNdbList != NULL)
// closeSchemaTransaction(theSchemaConToNdbList);
while ( theConIdleList != NULL )
@@ -249,6 +241,19 @@ Ndb::~Ndb()
delete theImpl;
+ /**
+ * This needs to be put after delete theImpl
+ * as TransporterFacade::instance is delete by global_ndb_cluster_connection
+ * and used by theImpl
+ */
+ if (global_ndb_cluster_connection != 0) {
+ theNoOfNdbObjects--;
+ if(theNoOfNdbObjects == 0){
+ delete global_ndb_cluster_connection;
+ global_ndb_cluster_connection= 0;
+ }
+ }//if
+
/**
* This sleep is to make sure that the transporter
* send thread will come in and send any
diff --git a/ndb/test/ndbapi/testBlobs.cpp b/ndb/test/ndbapi/testBlobs.cpp
index b2cc5636e45..7b30777456f 100644
--- a/ndb/test/ndbapi/testBlobs.cpp
+++ b/ndb/test/ndbapi/testBlobs.cpp
@@ -154,6 +154,7 @@ testcase(char x)
(g_opt.m_skip == 0 || strchr(g_opt.m_skip, x) == 0);
}
+static Ndb_cluster_connection* g_ncc = 0;
static Ndb* g_ndb = 0;
static NdbDictionary::Dictionary* g_dic = 0;
static NdbConnection* g_con = 0;
@@ -1259,7 +1260,7 @@ deleteScan(bool idx)
static int
testmain()
{
- g_ndb = new Ndb("TEST_DB");
+ g_ndb = new Ndb(g_ncc, "TEST_DB");
CHK(g_ndb->init() == 0);
CHK(g_ndb->waitUntilReady() == 0);
g_dic = g_ndb->getDictionary();
@@ -1448,7 +1449,7 @@ testperf()
if (! testcase('p'))
return 0;
DBG("=== perf test ===");
- g_ndb = new Ndb("TEST_DB");
+ g_ndb = new Ndb(g_ncc, "TEST_DB");
CHK(g_ndb->init() == 0);
CHK(g_ndb->waitUntilReady() == 0);
g_dic = g_ndb->getDictionary();
@@ -1860,10 +1861,13 @@ NDB_COMMAND(testOdbcDriver, "testBlobs", "testBlobs", "testBlobs", 65535)
strcat(b, "r");
g_opt.m_skip = strdup(b);
}
- if (testmain() == -1 || testperf() == -1) {
+ g_ncc = new Ndb_cluster_connection();
+ if (g_ncc->connect(30) != 0 || testmain() == -1 || testperf() == -1) {
ndbout << "line " << __LINE__ << " FAIL loop=" << g_loop << endl;
return NDBT_ProgramExit(NDBT_FAILED);
}
+ delete g_ncc;
+ g_ncc = 0;
return NDBT_ProgramExit(NDBT_OK);
}
diff --git a/ndb/test/ndbapi/testOIBasic.cpp b/ndb/test/ndbapi/testOIBasic.cpp
index 41f0686e63b..e6d3844d18e 100644
--- a/ndb/test/ndbapi/testOIBasic.cpp
+++ b/ndb/test/ndbapi/testOIBasic.cpp
@@ -59,7 +59,7 @@ struct Opt {
unsigned m_subloop;
const char* m_table;
unsigned m_threads;
- unsigned m_v;
+ int m_v;
Opt() :
m_batch(32),
m_bound("01234"),
@@ -672,6 +672,8 @@ tabcount = sizeof(tablist) / sizeof(tablist[0]);
// connections
+static Ndb_cluster_connection* g_ncc = 0;
+
struct Con {
Ndb* m_ndb;
NdbDictionary::Dictionary* m_dic;
@@ -720,7 +722,7 @@ int
Con::connect()
{
assert(m_ndb == 0);
- m_ndb = new Ndb("TEST_DB");
+ m_ndb = new Ndb(g_ncc, "TEST_DB");
CHKCON(m_ndb->init() == 0, *this);
CHKCON(m_ndb->waitUntilReady(30) == 0, *this);
m_tx = 0, m_op = 0;
@@ -3514,8 +3516,11 @@ NDB_COMMAND(testOIBasic, "testOIBasic", "testOIBasic", "testOIBasic", 65535)
}
{
Par par(g_opt);
- if (runtest(par) < 0)
+ g_ncc = new Ndb_cluster_connection();
+ if (g_ncc->connect(30) != 0 || runtest(par) < 0)
goto failed;
+ delete g_ncc;
+ g_ncc = 0;
}
// always exit with NDBT code
ok:
diff --git a/ndb/test/run-test/main.cpp b/ndb/test/run-test/main.cpp
index ac7710d9546..fb6754dae7a 100644
--- a/ndb/test/run-test/main.cpp
+++ b/ndb/test/run-test/main.cpp
@@ -275,6 +275,7 @@ parse_args(int argc, const char** argv){
int tmp = Logger::LL_WARNING - g_verbosity;
tmp = (tmp < Logger::LL_DEBUG ? Logger::LL_DEBUG : tmp);
g_logger.disable(Logger::LL_ALL);
+ g_logger.enable(Logger::LL_ON);
g_logger.enable((Logger::LoggerLevel)tmp, Logger::LL_ALERT);
}