summaryrefslogtreecommitdiff
path: root/storage/ndb/tools
diff options
context:
space:
mode:
authorunknown <tomas@whalegate.ndb.mysql.com>2007-04-12 11:12:43 +0200
committerunknown <tomas@whalegate.ndb.mysql.com>2007-04-12 11:12:43 +0200
commitf67c2668531d11185dff4a51aada0e3d1ca9f37f (patch)
treef268bba5a8eb1475ee761a6e94a45090c518bf27 /storage/ndb/tools
parent3f421aa4aca2e03cd1fdf4958291cbb2cc945520 (diff)
parentd7dadcd7c7668cf871f3b5cc00825dfaa6450c45 (diff)
downloadmariadb-git-f67c2668531d11185dff4a51aada0e3d1ca9f37f.tar.gz
Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-single-user storage/ndb/tools/restore/consumer_restore.cpp: Auto merged storage/ndb/tools/restore/restore_main.cpp: Auto merged sql/ha_ndbcluster.cc: null merge, 5.1 already reports correct error mysql-test/r/ndb_restore.result: manual merge mysql-test/t/ndb_restore.test: manual merge
Diffstat (limited to 'storage/ndb/tools')
-rw-r--r--storage/ndb/tools/restore/consumer_restore.cpp56
-rw-r--r--storage/ndb/tools/restore/restore_main.cpp4
2 files changed, 33 insertions, 27 deletions
diff --git a/storage/ndb/tools/restore/consumer_restore.cpp b/storage/ndb/tools/restore/consumer_restore.cpp
index e8f9842e554..30f227c2081 100644
--- a/storage/ndb/tools/restore/consumer_restore.cpp
+++ b/storage/ndb/tools/restore/consumer_restore.cpp
@@ -813,7 +813,7 @@ BackupRestore::table(const TableS & table){
BaseString tmp(name);
Vector<BaseString> split;
if(tmp.split(split, "/") != 3){
- err << "Invalid table name format " << name << endl;
+ err << "Invalid table name format `" << name << "`" << endl;
return false;
}
@@ -881,7 +881,7 @@ BackupRestore::table(const TableS & table){
if (dict->createTable(copy) == -1)
{
- err << "Create table " << table.getTableName() << " failed: "
+ err << "Create table `" << table.getTableName() << "` failed: "
<< dict->getNdbError() << endl;
if (dict->getNdbError().code == 771)
{
@@ -898,12 +898,13 @@ BackupRestore::table(const TableS & table){
}
return false;
}
- info << "Successfully restored table " << table.getTableName()<< endl ;
+ info << "Successfully restored table `"
+ << table.getTableName() << "`" << endl;
}
const NdbDictionary::Table* tab = dict->getTable(split[2].c_str());
if(tab == 0){
- err << "Unable to find table: " << split[2].c_str() << endl;
+ err << "Unable to find table: `" << split[2].c_str() << "`" << endl;
return false;
}
if(m_restore_meta)
@@ -965,12 +966,15 @@ BackupRestore::endOfTables(){
for(size_t i = 0; i<m_indexes.size(); i++){
NdbTableImpl & indtab = NdbTableImpl::getImpl(* m_indexes[i]);
- BaseString tmp(indtab.m_primaryTable.c_str());
Vector<BaseString> split;
- if(tmp.split(split, "/") != 3){
- err << "Invalid table name format " << indtab.m_primaryTable.c_str()
- << endl;
- return false;
+ {
+ BaseString tmp(indtab.m_primaryTable.c_str());
+ if (tmp.split(split, "/") != 3)
+ {
+ err << "Invalid table name format `" << indtab.m_primaryTable.c_str()
+ << "`" << endl;
+ return false;
+ }
}
m_ndb->setDatabaseName(split[0].c_str());
@@ -978,39 +982,41 @@ BackupRestore::endOfTables(){
const NdbDictionary::Table * prim = dict->getTable(split[2].c_str());
if(prim == 0){
- err << "Unable to find base table \"" << split[2].c_str()
- << "\" for index "
- << indtab.getName() << endl;
+ err << "Unable to find base table `" << split[2].c_str()
+ << "` for index `"
+ << indtab.getName() << "`" << endl;
return false;
}
NdbTableImpl& base = NdbTableImpl::getImpl(*prim);
NdbIndexImpl* idx;
- int id;
- char idxName[255], buf[255];
- if(sscanf(indtab.getName(), "%[^/]/%[^/]/%d/%s",
- buf, buf, &id, idxName) != 4){
- err << "Invalid index name format " << indtab.getName() << endl;
- return false;
+ Vector<BaseString> split_idx;
+ {
+ BaseString tmp(indtab.getName());
+ if (tmp.split(split_idx, "/") != 4)
+ {
+ err << "Invalid index name format `" << indtab.getName() << "`" << endl;
+ return false;
+ }
}
if(NdbDictInterface::create_index_obj_from_table(&idx, &indtab, &base))
{
- err << "Failed to create index " << idxName
- << " on " << split[2].c_str() << endl;
+ err << "Failed to create index `" << split_idx[3]
+ << "` on " << split[2].c_str() << endl;
return false;
}
- idx->setName(idxName);
+ idx->setName(split_idx[3].c_str());
if(dict->createIndex(* idx) != 0)
{
delete idx;
- err << "Failed to create index " << idxName
- << " on " << split[2].c_str() << endl
+ err << "Failed to create index `" << split_idx[3].c_str()
+ << "` on `" << split[2].c_str() << "`" << endl
<< dict->getNdbError() << endl;
return false;
}
delete idx;
- info << "Successfully created index " << idxName
- << " on " << split[2].c_str() << endl;
+ info << "Successfully created index `" << split_idx[3].c_str()
+ << "` on `" << split[2].c_str() << "`" << endl;
}
return true;
}
diff --git a/storage/ndb/tools/restore/restore_main.cpp b/storage/ndb/tools/restore/restore_main.cpp
index 8353f049647..adccd024d88 100644
--- a/storage/ndb/tools/restore/restore_main.cpp
+++ b/storage/ndb/tools/restore/restore_main.cpp
@@ -783,8 +783,8 @@ main(int argc, char** argv)
for(Uint32 j= 0; j < g_consumers.size(); j++)
if (!g_consumers[j]->table(* table))
{
- err << "Restore: Failed to restore table: ";
- err << table->getTableName() << " ... Exiting " << endl;
+ err << "Restore: Failed to restore table: `";
+ err << table->getTableName() << "` ... Exiting " << endl;
exitHandler(NDBT_FAILED);
}
} else {