ndb - 5.1.16 uint64 align for ndb_restore

storage/ndb/tools/restore/Restore.cpp:
  uint64 align patch
This commit is contained in:
unknown 2007-02-23 04:21:39 +01:00
parent 125d74e1fd
commit 5c65904072

View file

@ -59,7 +59,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: