Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-05-29 15:46:22+02:00, jonas@stripped +4 -0
ndb - bug#24363 - wl2325-5.0
storage/ndb/tools/restore/consumer.hpp@stripped, 2007-05-29 15:46:21+02:00, jonas@stripped +1 -0
ndb - bug24363 - wl2325-5.0
storage/ndb/tools/restore/consumer_restore.cpp@stripped, 2007-05-29 15:46:21+02:00, jonas@stripped +57 -0
ndb - bug24363 - wl2325-5.0
storage/ndb/tools/restore/consumer_restore.hpp@stripped, 2007-05-29 15:46:21+02:00, jonas@stripped +1 -0
ndb - bug24363 - wl2325-5.0
storage/ndb/tools/restore/restore_main.cpp@stripped, 2007-05-29 15:46:21+02:00, jonas@stripped +18 -0
ndb - bug24363 - wl2325-5.0
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jonas
# Host: perch.ndb.mysql.com
# Root: /home/jonas/src/drop5
--- 1.35/storage/ndb/tools/restore/restore_main.cpp 2007-05-29 15:46:25 +02:00
+++ 1.36/storage/ndb/tools/restore/restore_main.cpp 2007-05-29 15:46:25 +02:00
@@ -45,6 +45,7 @@
static bool ga_restore_epoch = false;
static bool ga_restore = false;
static bool ga_print = false;
+static bool ga_skip_table_check = false;
static int _print = 0;
static int _print_meta = 0;
static int _print_data = 0;
@@ -78,6 +79,9 @@
NDB_REP_DB "." NDB_APPLY_TABLE " with id 0 will be updated/inserted.",
(gptr*) &ga_restore_epoch, (gptr*) &ga_restore_epoch, 0,
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
+ { "skip-table-check", 's', "Skip table structure check during restore of data",
+ (gptr*) &ga_skip_table_check, (gptr*) &ga_skip_table_check, 0,
+ GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 },
{ "parallelism", 'p',
"No of parallel transactions during restore of data."
"(parallelism can be 1 to 1024)",
@@ -345,6 +349,20 @@
{
if(_restore_data || _print_data)
{
+ if (!ga_skip_table_check){
+ for(i=0; i < metaData.getNoOfTables(); i++){
+ if (checkSysTable(metaData[i]->getTableName()))
+ {
+ for(Uint32 j= 0; j < g_consumers.size(); j++)
+ if (!g_consumers[j]->table_equal(* metaData[i]))
+ {
+ err << "Restore: Failed to restore data, ";
+ err << metaData[i]->getTableName() << " table structure doesn't match backup ... Exiting " << endl;
+ exitHandler(NDBT_FAILED);
+ }
+ }
+ }
+ }
RestoreDataIterator dataIter(metaData, &free_data_callback);
// Read data file header
--- 1.8/storage/ndb/tools/restore/consumer.hpp 2007-05-29 15:46:25 +02:00
+++ 1.9/storage/ndb/tools/restore/consumer.hpp 2007-05-29 15:46:25 +02:00
@@ -37,6 +37,7 @@
virtual void endOfLogEntrys(){}
virtual bool finalize_table(const TableS &){return true;}
virtual bool update_apply_status(const RestoreMetaData &metaData){return true;}
+ virtual bool table_equal(const TableS &) {return true;}
};
#endif
--- 1.24/storage/ndb/tools/restore/consumer_restore.cpp 2007-05-29 15:46:25 +02:00
+++ 1.25/storage/ndb/tools/restore/consumer_restore.cpp 2007-05-29 15:46:25 +02:00
@@ -153,6 +153,63 @@
}
bool
+BackupRestore::table_equal(const TableS &tableS){
+ const char *tablename = tableS.getTableName();
+
+ if(tableS.m_dictTable == NULL){
+ ndbout<<"Table %s has no m_dictTable " << tablename << endl;
+ return false;
+ }
+ /**
+ * Ignore blob tables
+ */
+ if(match_blob(tablename) >= 0)
+ return true;
+
+ const NdbTableImpl & tmptab = NdbTableImpl::getImpl(* tableS.m_dictTable);
+ if ((int) tmptab.m_indexType != (int) NdbDictionary::Index::Undefined){
+ return true;
+ }
+
+ BaseString tmp(tablename);
+ Vector<BaseString> split;
+ if(tmp.split(split, "/") != 3){
+ err << "Invalid table name format " << tablename << endl;
+ return false;
+ }
+
+ m_ndb->setDatabaseName(split[0].c_str());
+ m_ndb->setSchemaName(split[1].c_str());
+
+ NdbDictionary::Dictionary* dict = m_ndb->getDictionary();
+ const NdbDictionary::Table* tab = dict->getTable(split[2].c_str());
+ if(tab == 0){
+ err << "Unable to find table: " << split[2].c_str() << endl;
+ return false;
+ }
+
+ if(tab->getNoOfColumns() != tableS.m_dictTable->getNoOfColumns())
+ {
+ ndbout_c("m_columns.size %d != %d",tab->getNoOfColumns(),
+ tableS.m_dictTable->getNoOfColumns());
+ return false;
+ }
+
+ for(int i = 0; i<tab->getNoOfColumns(); i++)
+ {
+ if(!tab->getColumn(i)->equal(*(tableS.m_dictTable->getColumn(i))))
+ {
+ ndbout_c("m_columns %s != %s",tab->getColumn(i)->getName(),
+ tableS.m_dictTable->getColumn(i)->getName());
+ return false;
+ }
+ }
+
+ return true;
+}
+
+
+bool
BackupRestore::update_apply_status(const RestoreMetaData &metaData)
{
if (!m_restore_epoch)
--- 1.11/storage/ndb/tools/restore/consumer_restore.hpp 2007-05-29 15:46:25 +02:00
+++ 1.12/storage/ndb/tools/restore/consumer_restore.hpp 2007-05-29 15:46:25 +02:00
@@ -63,6 +63,7 @@
virtual void endOfLogEntrys();
virtual bool finalize_table(const TableS &);
virtual bool update_apply_status(const RestoreMetaData &metaData);
+ virtual bool table_equal(const TableS & table);
void connectToMysql();
Ndb * m_ndb;
Ndb_cluster_connection * m_cluster_connection;
| Thread |
|---|
| • bk commit into 5.1 tree (jonas:1.2149) BUG#24363 | jonas | 29 May |