summaryrefslogtreecommitdiff
path: root/storage/ndb/tools/restore/consumer_restore.cpp
diff options
context:
space:
mode:
authorunknown <ndbdev@dl145c.mysql.com>2005-09-06 09:21:23 +0200
committerunknown <ndbdev@dl145c.mysql.com>2005-09-06 09:21:23 +0200
commit5ac4b631882c3b86e7d499d49620c48c3d890e36 (patch)
tree1840477eb8d180663c390c12acfeaefc37c6b0f0 /storage/ndb/tools/restore/consumer_restore.cpp
parentf6c1d4191cf001ba9e895e174bec2f443b28dbc0 (diff)
parent7b2aacb73d43b8d6fa62167610c0cd1e734ffed9 (diff)
downloadmariadb-git-5ac4b631882c3b86e7d499d49620c48c3d890e36.tar.gz
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into dl145c.mysql.com:/home/ndbdev/tomas/mysql-5.1 storage/ndb/include/util/ndb_opts.h: Auto merged storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: Auto merged storage/ndb/src/kernel/error/ErrorReporter.cpp: Auto merged storage/ndb/src/kernel/error/ErrorReporter.hpp: Auto merged storage/ndb/src/kernel/main.cpp: Auto merged storage/ndb/src/kernel/vm/Emulator.cpp: Auto merged storage/ndb/src/kernel/vm/Emulator.hpp: Auto merged storage/ndb/src/mgmsrv/ConfigInfo.cpp: Auto merged storage/ndb/src/mgmsrv/MgmtSrvr.cpp: Auto merged storage/ndb/src/mgmsrv/Services.cpp: Auto merged storage/ndb/tools/Makefile.am: Auto merged storage/ndb/tools/ndb_condig.cpp: Auto merged storage/ndb/tools/restore/consumer_restore.cpp: Auto merged storage/ndb/tools/restore/restore_main.cpp: Auto merged
Diffstat (limited to 'storage/ndb/tools/restore/consumer_restore.cpp')
-rw-r--r--storage/ndb/tools/restore/consumer_restore.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/storage/ndb/tools/restore/consumer_restore.cpp b/storage/ndb/tools/restore/consumer_restore.cpp
index 9dd8c4bf92d..5786bdac697 100644
--- a/storage/ndb/tools/restore/consumer_restore.cpp
+++ b/storage/ndb/tools/restore/consumer_restore.cpp
@@ -14,9 +14,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
+#include <NDBT_ReturnCodes.h>
#include "consumer_restore.hpp"
#include <NdbSleep.h>
+extern my_bool opt_core;
+
extern FilteredNdbOut err;
extern FilteredNdbOut info;
extern FilteredNdbOut debug;
@@ -472,7 +475,11 @@ bool BackupRestore::errorHandler(restore_callback_t *cb)
void BackupRestore::exitHandler()
{
release();
- exit(-1);
+ NDBT_ProgramExit(NDBT_FAILED);
+ if (opt_core)
+ abort();
+ else
+ exit(NDBT_FAILED);
}
@@ -506,7 +513,7 @@ BackupRestore::logEntry(const LogEntry & tup)
{
// Deep shit, TODO: handle the error
err << "Cannot start transaction" << endl;
- exit(-1);
+ exitHandler();
} // if
const NdbDictionary::Table * table = get_table(tup.m_table->m_dictTable);
@@ -514,7 +521,7 @@ BackupRestore::logEntry(const LogEntry & tup)
if (op == NULL)
{
err << "Cannot get operation: " << trans->getNdbError() << endl;
- exit(-1);
+ exitHandler();
} // if
int check = 0;
@@ -532,13 +539,13 @@ BackupRestore::logEntry(const LogEntry & tup)
default:
err << "Log entry has wrong operation type."
<< " Exiting...";
- exit(-1);
+ exitHandler();
}
if (check != 0)
{
err << "Error defining op: " << trans->getNdbError() << endl;
- exit(-1);
+ exitHandler();
} // if
Bitmask<4096> keys;
@@ -567,7 +574,7 @@ BackupRestore::logEntry(const LogEntry & tup)
if (check != 0)
{
err << "Error defining op: " << trans->getNdbError() << endl;
- exit(-1);
+ exitHandler();
} // if
}
@@ -596,7 +603,7 @@ BackupRestore::logEntry(const LogEntry & tup)
if (!ok)
{
err << "execute failed: " << errobj << endl;
- exit(-1);
+ exitHandler();
}
}
@@ -643,7 +650,7 @@ BackupRestore::tuple(const TupleS & tup)
{
// Deep shit, TODO: handle the error
ndbout << "Cannot start transaction" << endl;
- exit(-1);
+ exitHandler();
} // if
const TableS * table = tup.getTable();
@@ -652,7 +659,7 @@ BackupRestore::tuple(const TupleS & tup)
{
ndbout << "Cannot get operation: ";
ndbout << trans->getNdbError() << endl;
- exit(-1);
+ exitHandler();
} // if
// TODO: check return value and handle error
@@ -660,7 +667,7 @@ BackupRestore::tuple(const TupleS & tup)
{
ndbout << "writeTuple call failed: ";
ndbout << trans->getNdbError() << endl;
- exit(-1);
+ exitHandler();
} // if
for (int i = 0; i < tup.getNoOfAttributes(); i++)
@@ -694,7 +701,7 @@ BackupRestore::tuple(const TupleS & tup)
{
ndbout << "execute failed: ";
ndbout << trans->getNdbError() << endl;
- exit(-1);
+ exitHandler();
}
m_ndb->closeTransaction(trans);
if (ret == 0)