diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2004-11-18 21:43:03 +0000 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2004-11-18 21:43:03 +0000 |
commit | 1af6e72e4ebb65a392658a2dab795fda68564af0 (patch) | |
tree | 38be690e3e694c7e644d3a6394d2ce061d5abd72 | |
parent | a8ba534cee918abd55df54be7136385b57155044 (diff) | |
parent | 13710e869fb66e6dc9f21a974b43a3c0dd821535 (diff) | |
download | mariadb-git-1af6e72e4ebb65a392658a2dab795fda68564af0.tar.gz |
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1
into poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-clean
-rw-r--r-- | ndb/src/mgmclient/CommandInterpreter.cpp | 7 | ||||
-rw-r--r-- | ndb/tools/Makefile.am | 2 | ||||
-rw-r--r-- | ndb/tools/restore/restore_main.cpp (renamed from ndb/tools/restore/main.cpp) | 29 |
3 files changed, 28 insertions, 10 deletions
diff --git a/ndb/src/mgmclient/CommandInterpreter.cpp b/ndb/src/mgmclient/CommandInterpreter.cpp index a36263395ec..bdeb885ed8b 100644 --- a/ndb/src/mgmclient/CommandInterpreter.cpp +++ b/ndb/src/mgmclient/CommandInterpreter.cpp @@ -1386,7 +1386,7 @@ void CommandInterpreter::executeDumpState(int processId, const char* parameters, bool all) { - if(parameters == 0 || strlen(parameters) == 0){ + if(emptyString(parameters)){ ndbout << "Expected argument" << endl; return; } @@ -1806,6 +1806,10 @@ CommandInterpreter::executeEventReporting(int processId, const char* parameters, bool all) { + if (emptyString(parameters)) { + ndbout << "Expected argument" << endl; + return; + } connect(); BaseString tmp(parameters); @@ -1906,6 +1910,7 @@ void CommandInterpreter::executeAbortBackup(char* parameters) { connect(); + strtok(parameters, " "); struct ndb_mgm_reply reply; char* id = strtok(NULL, "\0"); diff --git a/ndb/tools/Makefile.am b/ndb/tools/Makefile.am index 9c086d665c1..7a61a9b1be5 100644 --- a/ndb/tools/Makefile.am +++ b/ndb/tools/Makefile.am @@ -26,7 +26,7 @@ ndb_select_all_SOURCES = select_all.cpp \ ../test/src/NDBT_ResultRow.cpp \ $(tools_common_sources) ndb_select_count_SOURCES = select_count.cpp $(tools_common_sources) -ndb_restore_SOURCES = restore/main.cpp \ +ndb_restore_SOURCES = restore/restore_main.cpp \ restore/consumer.cpp \ restore/consumer_restore.cpp \ restore/consumer_printer.cpp \ diff --git a/ndb/tools/restore/main.cpp b/ndb/tools/restore/restore_main.cpp index 482212911cb..c43791c6723 100644 --- a/ndb/tools/restore/main.cpp +++ b/ndb/tools/restore/restore_main.cpp @@ -74,7 +74,7 @@ static struct my_option my_long_options[] = "No of parallel transactions during restore of data." "(parallelism can be 1 to 1024)", (gptr*) &ga_nParallelism, (gptr*) &ga_nParallelism, 0, - GET_INT, REQUIRED_ARG, 128, 0, 0, 0, 0, 0 }, + GET_INT, REQUIRED_ARG, 128, 1, 1024, 0, 1, 0 }, { "print", 256, "Print data and log to stdout", (gptr*) &_print, (gptr*) &_print, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, @@ -120,6 +120,20 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case 'V': print_version(); exit(0); + case 'n': + if (ga_nodeId == 0) + { + printf("Error in --nodeid,-n setting, see --help\n"); + exit(1); + } + break; + case 'b': + if (ga_backupId == 0) + { + printf("Error in --backupid,-b setting, see --help\n"); + exit(1); + } + break; case '?': usage(); exit(0); @@ -131,11 +145,8 @@ readArguments(int *pargc, char*** pargv) { const char *load_default_groups[]= { "ndb_tools","ndb_restore",0 }; load_defaults("my",load_default_groups,pargc,pargv); - if (handle_options(pargc, pargv, my_long_options, get_one_option) || - ga_nodeId == 0 || - ga_backupId == 0 || - ga_nParallelism < 1 || - ga_nParallelism >1024) { + if (handle_options(pargc, pargv, my_long_options, get_one_option)) + { exit(1); } @@ -343,7 +354,8 @@ main(int argc, char** argv) if (res < 0) { - err << "Restore: An error occured while restoring data. Exiting... res=" << res << endl; + err << "Restore: An error occured while restoring data. Exiting... " + << "res=" << res << endl; return -1; } @@ -369,7 +381,8 @@ main(int argc, char** argv) } if (res < 0) { - err << "Restore: An restoring the data log. Exiting... res=" << res << endl; + err << "Restore: An restoring the data log. Exiting... res=" + << res << endl; return -1; } logIter.validateFooter(); //not implemented |