summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <tomas@whalegate.ndb.mysql.com>2007-08-23 15:17:44 +0200
committerunknown <tomas@whalegate.ndb.mysql.com>2007-08-23 15:17:44 +0200
commit650e06af70e21b8eaef4b0455b81a02795a387e4 (patch)
tree8f3e67a731f6f67af1d1549b3cf6adf6c37556f9
parentfc766e515e05624708dbfbf4983b3449097f2693 (diff)
downloadmariadb-git-650e06af70e21b8eaef4b0455b81a02795a387e4.tar.gz
BUG#30134 restore of backup from different endian can work for timestamp column
(recommit for 5.1.22 target) storage/ndb/tools/restore/Restore.cpp: Convert byte order of timestamp data type
-rw-r--r--storage/ndb/tools/restore/Restore.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/storage/ndb/tools/restore/Restore.cpp b/storage/ndb/tools/restore/Restore.cpp
index 516dfe24855..8764da7f50c 100644
--- a/storage/ndb/tools/restore/Restore.cpp
+++ b/storage/ndb/tools/restore/Restore.cpp
@@ -607,7 +607,10 @@ RestoreDataIterator::getNextTuple(int & res)
attr_data->size = 4*sz;
//if (m_currentTable->getTableId() >= 2) { ndbout << "fix i=" << i << " off=" << ptr-buf_ptr << " attrId=" << attrId << endl; }
-
+ if(!m_hostByteOrder
+ && attr_desc->m_column->getType() == NdbDictionary::Column::Timestamp)
+ attr_data->u_int32_value[0] = Twiddle32(attr_data->u_int32_value[0]);
+
if(!Twiddle(attr_desc, attr_data))
{
res = -1;