diff options
author | unknown <pekka@mysql.com> | 2006-05-02 14:33:55 +0200 |
---|---|---|
committer | unknown <pekka@mysql.com> | 2006-05-02 14:33:55 +0200 |
commit | e93b203d08dd7f64b140485993ac85791343e115 (patch) | |
tree | df2c1b2c7520bcb59e8e099c028639d568c20a77 /ndb/tools | |
parent | 7400f10a887232653ac0d26d214e3d4256d6463d (diff) | |
download | mariadb-git-e93b203d08dd7f64b140485993ac85791343e115.tar.gz |
ndb - bug#19201 (4.1), see comment in NdbBlob.cpp
ndb/test/ndbapi/testBlobs.cpp:
option -fac (fetch across commit)
ndb/tools/delete_all.cpp:
option --transactional (default remains truncate)
mysql-test/r/ndb_blob.result:
bug#19201
mysql-test/t/ndb_blob.test:
bug#19201
ndb/include/kernel/signaldata/TcKeyReq.hpp:
bug#19201
ndb/include/ndbapi/NdbBlob.hpp:
bug#19201
ndb/src/ndbapi/NdbBlob.cpp:
bug#19201
Diffstat (limited to 'ndb/tools')
-rw-r--r-- | ndb/tools/delete_all.cpp | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/ndb/tools/delete_all.cpp b/ndb/tools/delete_all.cpp index d4a07fdf505..c1ab77cb39f 100644 --- a/ndb/tools/delete_all.cpp +++ b/ndb/tools/delete_all.cpp @@ -23,17 +23,21 @@ #include <NDBT.hpp> static int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, - bool commit_across_open_cursor, int parallelism=240); + bool fetch_across_commit, int parallelism=240); NDB_STD_OPTS_VARS; static const char* _dbname = "TEST_DB"; +static my_bool _transactional = false; static struct my_option my_long_options[] = { NDB_STD_OPTS("ndb_desc"), { "database", 'd', "Name of database table is in", (gptr*) &_dbname, (gptr*) &_dbname, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, + { "transactional", 't', "Single transaction (may run out of operations)", + (gptr*) &_transactional, (gptr*) &_transactional, 0, + GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} }; static void usage() @@ -82,18 +86,11 @@ int main(int argc, char** argv){ ndbout << " Table " << argv[i] << " does not exist!" << endl; return NDBT_ProgramExit(NDBT_WRONGARGS); } - // Check if we have any blobs - bool commit_across_open_cursor = true; - for (int j = 0; j < pTab->getNoOfColumns(); j++) { - NdbDictionary::Column::Type t = pTab->getColumn(j)->getType(); - if (t == NdbDictionary::Column::Blob || - t == NdbDictionary::Column::Text) { - commit_across_open_cursor = false; - break; - } - } - ndbout << "Deleting all from " << argv[i] << "..."; - if(clear_table(&MyNdb, pTab, commit_across_open_cursor) == NDBT_FAILED){ + ndbout << "Deleting all from " << argv[i]; + if (! _transactional) + ndbout << " (non-transactional)"; + ndbout << " ..."; + if(clear_table(&MyNdb, pTab, ! _transactional) == NDBT_FAILED){ res = NDBT_FAILED; ndbout << "FAILED" << endl; } @@ -103,7 +100,7 @@ int main(int argc, char** argv){ int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, - bool commit_across_open_cursor, int parallelism) + bool fetch_across_commit, int parallelism) { // Scan all records exclusive and delete // them one by one @@ -134,7 +131,7 @@ int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, } goto failed; } - + pOp = pTrans->getNdbScanOperation(pTab->getName()); if (pOp == NULL) { goto failed; @@ -165,7 +162,7 @@ int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, } while((check = rs->nextResult(false)) == 0); if(check != -1){ - if (commit_across_open_cursor) { + if (fetch_across_commit) { check = pTrans->execute(Commit); pTrans->restart(); // new tx id } else { @@ -196,7 +193,7 @@ int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, } goto failed; } - if (! commit_across_open_cursor && pTrans->execute(Commit) != 0) { + if (! fetch_across_commit && pTrans->execute(Commit) != 0) { err = pTrans->getNdbError(); goto failed; } |