summaryrefslogtreecommitdiff
path: root/ndb/tools/restore
diff options
context:
space:
mode:
authorunknown <tomas@whalegate.ndb.mysql.com>2007-04-13 01:37:24 +0200
committerunknown <tomas@whalegate.ndb.mysql.com>2007-04-13 01:37:24 +0200
commit53fa178cb93f2cf67e0ba92bc20006dc58471f4f (patch)
tree28fae0a3b7c331890a4c908817fc4f4df702d189 /ndb/tools/restore
parentdc3c54706f1d9f96584bc139ded10b56624e5d37 (diff)
downloadmariadb-git-53fa178cb93f2cf67e0ba92bc20006dc58471f4f.tar.gz
Bug#27775 mediumint auto_increment with ndb_restore
- autoincrement column of size medium int not handled in ndb_restore - added testcase also for other types, tiny, small... etc
Diffstat (limited to 'ndb/tools/restore')
-rw-r--r--ndb/tools/restore/Restore.hpp3
-rw-r--r--ndb/tools/restore/consumer_restore.cpp4
2 files changed, 5 insertions, 2 deletions
diff --git a/ndb/tools/restore/Restore.hpp b/ndb/tools/restore/Restore.hpp
index 66e00d88dfe..c1545159ce4 100644
--- a/ndb/tools/restore/Restore.hpp
+++ b/ndb/tools/restore/Restore.hpp
@@ -219,6 +219,9 @@ public:
memcpy(&val.u32,data,4);
v= val.u32;
break;
+ case 24:
+ v= uint3korr((unsigned char*)data);
+ break;
case 16:
memcpy(&val.u16,data,2);
v= val.u16;
diff --git a/ndb/tools/restore/consumer_restore.cpp b/ndb/tools/restore/consumer_restore.cpp
index d15cfea07df..811868f3e77 100644
--- a/ndb/tools/restore/consumer_restore.cpp
+++ b/ndb/tools/restore/consumer_restore.cpp
@@ -388,7 +388,7 @@ void BackupRestore::tuple_a(restore_callback_t *cb)
Uint32 length = (size * arraySize) / 8;
if (j == 0 && tup.getTable()->have_auto_inc(i))
- tup.getTable()->update_max_auto_val(dataPtr,size);
+ tup.getTable()->update_max_auto_val(dataPtr,size*arraySize);
if (attr_desc->m_column->getPrimaryKey())
{
@@ -602,7 +602,7 @@ BackupRestore::logEntry(const LogEntry & tup)
const char * dataPtr = attr->Data.string_value;
if (tup.m_table->have_auto_inc(attr->Desc->attrId))
- tup.m_table->update_max_auto_val(dataPtr,size);
+ tup.m_table->update_max_auto_val(dataPtr,size*arraySize);
const Uint32 length = (size / 8) * arraySize;
if (attr->Desc->m_column->getPrimaryKey())