Commit 2e620e3d authored by tomas@whalegate.ndb.mysql.com's avatar tomas@whalegate.ndb.mysql.com

Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb

into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-single-user
parents ec6476cb f9a900f8
...@@ -16,7 +16,7 @@ CREATE TABLE `t2_c` ( ...@@ -16,7 +16,7 @@ CREATE TABLE `t2_c` (
`descrpooppo` varchar(64) default NULL, `descrpooppo` varchar(64) default NULL,
`svcutonsa` varchar(64) NOT NULL default '', `svcutonsa` varchar(64) NOT NULL default '',
PRIMARY KEY (`capgotod`), PRIMARY KEY (`capgotod`),
KEY `i_quadaddsvr` (`gotod`) KEY `i quadaddsvr` (`gotod`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1; ) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
INSERT INTO `t2_c` VALUES (5,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST'); INSERT INTO `t2_c` VALUES (5,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST');
CREATE TABLE `t3_c` ( CREATE TABLE `t3_c` (
......
...@@ -15,7 +15,10 @@ CREATE TABLE `t1_c` ( ...@@ -15,7 +15,10 @@ CREATE TABLE `t1_c` (
PRIMARY KEY (`capgoaledatta`,`goaledatta`,`maturegarbagefa`) PRIMARY KEY (`capgoaledatta`,`goaledatta`,`maturegarbagefa`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1; ) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
INSERT INTO `t1_c` VALUES (2,'3','q3plus.qt'),(4,'4','q3plus.qt'),(1,'3','q3.net'),(3,'4','q3.net'),(3,'20','threetrees.qt'); INSERT INTO `t1_c` VALUES (2,'3','q3plus.qt'),(4,'4','q3plus.qt'),(1,'3','q3.net'),(3,'4','q3.net'),(3,'20','threetrees.qt');
#
# Bug #27758 Restoring NDB backups makes table usable in SQL nodes
# - space in key made table unusable after restore
#
CREATE TABLE `t2_c` ( CREATE TABLE `t2_c` (
`capgotod` smallint(5) unsigned NOT NULL auto_increment, `capgotod` smallint(5) unsigned NOT NULL auto_increment,
`gotod` smallint(5) unsigned NOT NULL default '0', `gotod` smallint(5) unsigned NOT NULL default '0',
...@@ -24,7 +27,7 @@ CREATE TABLE `t2_c` ( ...@@ -24,7 +27,7 @@ CREATE TABLE `t2_c` (
`descrpooppo` varchar(64) default NULL, `descrpooppo` varchar(64) default NULL,
`svcutonsa` varchar(64) NOT NULL default '', `svcutonsa` varchar(64) NOT NULL default '',
PRIMARY KEY (`capgotod`), PRIMARY KEY (`capgotod`),
KEY `i_quadaddsvr` (`gotod`) KEY `i quadaddsvr` (`gotod`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1; ) ENGINE=ndbcluster DEFAULT CHARSET=latin1;
INSERT INTO `t2_c` VALUES (5,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST'); INSERT INTO `t2_c` VALUES (5,4,'','q3.net','addavp:MK_CASELECTOR=1','postorod rattoaa'),(2,1,'4','','addavp:MK_BRANDTAD=345','REDS Brandtad'),(3,2,'4','q3.net','execorder','fixedRatediPO REDS'),(1,1,'3','','addavp:MK_BRANDTAD=123','TEST Brandtad'),(6,5,'','told.q3.net','addavp:MK_BRANDTAD=123','Brandtad Toldzone'),(4,3,'3','q3.net','addavp:MK_POOLHINT=2','ratedi PO TEST');
......
...@@ -813,7 +813,7 @@ BackupRestore::table(const TableS & table){ ...@@ -813,7 +813,7 @@ BackupRestore::table(const TableS & table){
BaseString tmp(name); BaseString tmp(name);
Vector<BaseString> split; Vector<BaseString> split;
if(tmp.split(split, "/") != 3){ if(tmp.split(split, "/") != 3){
err << "Invalid table name format " << name << endl; err << "Invalid table name format `" << name << "`" << endl;
return false; return false;
} }
...@@ -881,7 +881,7 @@ BackupRestore::table(const TableS & table){ ...@@ -881,7 +881,7 @@ BackupRestore::table(const TableS & table){
if (dict->createTable(copy) == -1) if (dict->createTable(copy) == -1)
{ {
err << "Create table " << table.getTableName() << " failed: " err << "Create table `" << table.getTableName() << "` failed: "
<< dict->getNdbError() << endl; << dict->getNdbError() << endl;
if (dict->getNdbError().code == 771) if (dict->getNdbError().code == 771)
{ {
...@@ -898,12 +898,13 @@ BackupRestore::table(const TableS & table){ ...@@ -898,12 +898,13 @@ BackupRestore::table(const TableS & table){
} }
return false; 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()); const NdbDictionary::Table* tab = dict->getTable(split[2].c_str());
if(tab == 0){ 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; return false;
} }
if(m_restore_meta) if(m_restore_meta)
...@@ -965,12 +966,15 @@ BackupRestore::endOfTables(){ ...@@ -965,12 +966,15 @@ BackupRestore::endOfTables(){
for(size_t i = 0; i<m_indexes.size(); i++){ for(size_t i = 0; i<m_indexes.size(); i++){
NdbTableImpl & indtab = NdbTableImpl::getImpl(* m_indexes[i]); NdbTableImpl & indtab = NdbTableImpl::getImpl(* m_indexes[i]);
BaseString tmp(indtab.m_primaryTable.c_str());
Vector<BaseString> split; Vector<BaseString> split;
if(tmp.split(split, "/") != 3){ {
err << "Invalid table name format " << indtab.m_primaryTable.c_str() BaseString tmp(indtab.m_primaryTable.c_str());
<< endl; if (tmp.split(split, "/") != 3)
return false; {
err << "Invalid table name format `" << indtab.m_primaryTable.c_str()
<< "`" << endl;
return false;
}
} }
m_ndb->setDatabaseName(split[0].c_str()); m_ndb->setDatabaseName(split[0].c_str());
...@@ -978,39 +982,41 @@ BackupRestore::endOfTables(){ ...@@ -978,39 +982,41 @@ BackupRestore::endOfTables(){
const NdbDictionary::Table * prim = dict->getTable(split[2].c_str()); const NdbDictionary::Table * prim = dict->getTable(split[2].c_str());
if(prim == 0){ if(prim == 0){
err << "Unable to find base table \"" << split[2].c_str() err << "Unable to find base table `" << split[2].c_str()
<< "\" for index " << "` for index `"
<< indtab.getName() << endl; << indtab.getName() << "`" << endl;
return false; return false;
} }
NdbTableImpl& base = NdbTableImpl::getImpl(*prim); NdbTableImpl& base = NdbTableImpl::getImpl(*prim);
NdbIndexImpl* idx; NdbIndexImpl* idx;
int id; Vector<BaseString> split_idx;
char idxName[255], buf[255]; {
if(sscanf(indtab.getName(), "%[^/]/%[^/]/%d/%s", BaseString tmp(indtab.getName());
buf, buf, &id, idxName) != 4){ if (tmp.split(split_idx, "/") != 4)
err << "Invalid index name format " << indtab.getName() << endl; {
return false; err << "Invalid index name format `" << indtab.getName() << "`" << endl;
return false;
}
} }
if(NdbDictInterface::create_index_obj_from_table(&idx, &indtab, &base)) if(NdbDictInterface::create_index_obj_from_table(&idx, &indtab, &base))
{ {
err << "Failed to create index " << idxName err << "Failed to create index `" << split_idx[3]
<< " on " << split[2].c_str() << endl; << "` on " << split[2].c_str() << endl;
return false; return false;
} }
idx->setName(idxName); idx->setName(split_idx[3].c_str());
if(dict->createIndex(* idx) != 0) if(dict->createIndex(* idx) != 0)
{ {
delete idx; delete idx;
err << "Failed to create index " << idxName err << "Failed to create index `" << split_idx[3].c_str()
<< " on " << split[2].c_str() << endl << "` on `" << split[2].c_str() << "`" << endl
<< dict->getNdbError() << endl; << dict->getNdbError() << endl;
return false; return false;
} }
delete idx; delete idx;
info << "Successfully created index " << idxName info << "Successfully created index `" << split_idx[3].c_str()
<< " on " << split[2].c_str() << endl; << "` on `" << split[2].c_str() << "`" << endl;
} }
return true; return true;
} }
......
...@@ -783,8 +783,8 @@ main(int argc, char** argv) ...@@ -783,8 +783,8 @@ main(int argc, char** argv)
for(Uint32 j= 0; j < g_consumers.size(); j++) for(Uint32 j= 0; j < g_consumers.size(); j++)
if (!g_consumers[j]->table(* table)) if (!g_consumers[j]->table(* table))
{ {
err << "Restore: Failed to restore table: "; err << "Restore: Failed to restore table: `";
err << table->getTableName() << " ... Exiting " << endl; err << table->getTableName() << "` ... Exiting " << endl;
exitHandler(NDBT_FAILED); exitHandler(NDBT_FAILED);
} }
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment