summaryrefslogtreecommitdiff
path: root/ndb/tools
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2004-12-09 14:04:27 +0100
committerunknown <joreland@mysql.com>2004-12-09 14:04:27 +0100
commitd1ec91be3faf7787c9d3e5220c945ed13c7b8350 (patch)
treef7fec4bdf472b8a2635be55b71df0322d92faac7 /ndb/tools
parent809ea73208ab3edd36cad744918a1d4d3785411a (diff)
parentf67fe154dd4025ccf0e1f74b0841410c80f21a46 (diff)
downloadmariadb-git-d1ec91be3faf7787c9d3e5220c945ed13c7b8350.tar.gz
Merge mysql.com:/home/jonas/src/mysql-4.1-fix
into mysql.com:/home/jonas/src/mysql-4.1 ndb/src/kernel/blocks/backup/Backup.cpp: Auto merged ndb/src/kernel/blocks/backup/Backup.hpp: Auto merged ndb/src/kernel/blocks/backup/BackupInit.cpp: Auto merged ndb/tools/restore/restore_main.cpp: Auto merged
Diffstat (limited to 'ndb/tools')
-rw-r--r--ndb/tools/restore/Restore.cpp12
-rw-r--r--ndb/tools/restore/Restore.hpp2
-rw-r--r--ndb/tools/restore/restore_main.cpp9
3 files changed, 15 insertions, 8 deletions
diff --git a/ndb/tools/restore/Restore.cpp b/ndb/tools/restore/Restore.cpp
index 6e2fcaed3af..277cdc72532 100644
--- a/ndb/tools/restore/Restore.cpp
+++ b/ndb/tools/restore/Restore.cpp
@@ -192,14 +192,15 @@ RestoreMetaData::readGCPEntry() {
return true;
}
-TableS::TableS(NdbTableImpl* tableImpl)
+TableS::TableS(Uint32 version, NdbTableImpl* tableImpl)
: m_dictTable(tableImpl)
{
m_dictTable = tableImpl;
m_noOfNullable = m_nullBitmaskSize = 0;
m_auto_val_id= ~(Uint32)0;
m_max_auto_val= 0;
-
+ backupVersion = version;
+
for (int i = 0; i < tableImpl->getNoOfColumns(); i++)
createAttr(tableImpl->getColumn(i));
}
@@ -226,11 +227,10 @@ RestoreMetaData::parseTableDescriptor(const Uint32 * data, Uint32 len)
debug << "parseTableInfo " << tableImpl->getName() << " done" << endl;
- TableS * table = new TableS(tableImpl);
+ TableS * table = new TableS(m_fileHeader.NdbVersion, tableImpl);
if(table == NULL) {
return false;
}
- table->setBackupVersion(m_fileHeader.NdbVersion);
debug << "Parsed table id " << table->getTableId() << endl;
debug << "Parsed table #attr " << table->getNoOfAttributes() << endl;
@@ -699,12 +699,12 @@ void TableS::createAttr(NdbDictionary::Column *column)
if (d->m_column->getAutoIncrement())
m_auto_val_id= d->attrId;
- if(d->m_column->getPrimaryKey() /* && not variable */)
+ if(d->m_column->getPrimaryKey() && backupVersion <= MAKE_VERSION(4,1,7))
{
m_fixedKeys.push_back(d);
return;
}
-
+
if(!d->m_column->getNullable())
{
m_fixedAttribs.push_back(d);
diff --git a/ndb/tools/restore/Restore.hpp b/ndb/tools/restore/Restore.hpp
index 82fcdcdb183..e0b06c1774c 100644
--- a/ndb/tools/restore/Restore.hpp
+++ b/ndb/tools/restore/Restore.hpp
@@ -140,7 +140,7 @@ class TableS {
public:
class NdbDictionary::Table* m_dictTable;
- TableS (class NdbTableImpl* dictTable);
+ TableS (Uint32 version, class NdbTableImpl* dictTable);
~TableS();
Uint32 getTableId() const {
diff --git a/ndb/tools/restore/restore_main.cpp b/ndb/tools/restore/restore_main.cpp
index 409ebd54764..ece2b2605b4 100644
--- a/ndb/tools/restore/restore_main.cpp
+++ b/ndb/tools/restore/restore_main.cpp
@@ -258,11 +258,18 @@ main(int argc, char** argv)
ndbout << "Failed to read " << metaData.getFilename() << endl << endl;
return -1;
}
+
+ const BackupFormat::FileHeader & tmp = metaData.getFileHeader();
+ const Uint32 version = tmp.NdbVersion;
+
+ ndbout << "Ndb version in backup files: "
+ << getVersionString(version, 0) << endl;
+
/**
* check wheater we can restore the backup (right version).
*/
int res = metaData.loadContent();
-
+
if (res == 0)
{
ndbout_c("Restore: Failed to load content");