summaryrefslogtreecommitdiff
path: root/ndb/tools
diff options
context:
space:
mode:
Diffstat (limited to 'ndb/tools')
-rw-r--r--ndb/tools/restore/Restore.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/ndb/tools/restore/Restore.cpp b/ndb/tools/restore/Restore.cpp
index 9aa79f4dc94..8b2e9a799a4 100644
--- a/ndb/tools/restore/Restore.cpp
+++ b/ndb/tools/restore/Restore.cpp
@@ -54,7 +54,12 @@ BackupFile::Twiddle(const AttributeDesc* attr_desc, AttributeData* attr_data, Ui
return true;
case 64:
for(i = 0; i<arraySize; i++){
- attr_data->u_int64_value[i] = Twiddle64(attr_data->u_int64_value[i]);
+ // allow unaligned
+ char* p = (char*)&attr_data->u_int64_value[i];
+ Uint64 x;
+ memcpy(&x, p, sizeof(Uint64));
+ x = Twiddle64(x);
+ memcpy(p, &x, sizeof(Uint64));
}
return true;
default: