Bug #30134 restore of backup from different endian does not work for timestamp column
Submitted: 31 Jul 2007 3:35 Modified: 23 Aug 2007 14:09
Reporter: li zhou Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:5.1 OS:Solaris (linux <-> solaris)
Assigned to: li zhou CPU Architecture:Any

[31 Jul 2007 3:35] li zhou
Description:
Do backup on a big-endian machine with 'timestamp' type attribute, and copy backuped
data to a little-endian machine, then restore it. Will find that the restored
'timestamp' data is not correct.

How to repeat:
1. start a 2 data nodes cluster on a SUN SPARC Solaris machine.
2. create a table with "timestamp"  attribute, and insert values into it.
   mysql> use test;
   mysql> create table t1 (a int primary key, b timestamp) engine=ndbcluster;
   mysql> insert into t1 values (1, 20021029165106);
   mysql> select * from t1;
   +---+---------------------+
   | a | b                   |
   +---+---------------------+
   | 1 | 2002-10-29 16:51:06 |
   +---+---------------------+
   1 row in set (0.00 sec)
3. start backup on solaris
   ./bin/ndb_mgm -e "start backup"
4. copy the backuped data to a X86 Linux machine.
   scp -r data/node3/BACKUP/BACKUP-1/* x86-machine:/tmp/BACKUPS/BACKUP-1/
   .....
5. start a same configure cluster as SUN machine on X86 machine.
6. restore database.
   ./bin/ndb_restore -n 1 -b 1 -m -r /tmp/BACKUPS/BACKUP-1
   ./bin/ndb_restore -n 2 -b 1 -r /tmp/BACKUPS/BACKUP-1
7. do select on linux.
   mysql> select * from t1;
   +---+---------------------+
   | a | b                   |
   +---+---------------------+
   | 1 | 2009-08-24 19:22:21 |
   +---+---------------------+
   1 row in set (0.07 sec)

Suggested fix:
Ndb backup/restore for timestamp attribute should be endian compatible in 5.1.
[31 Jul 2007 7:23] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/31873

ChangeSet@1.2524, 2007-07-31 15:09:16+00:00, lzhou@dev3-63.(none) +1 -0
  BUG#30134 restore of backup from different endian can work for timestamp column
[10 Aug 2007 1:41] Stewart Smith
looks good. ok to push.
[15 Aug 2007 8:55] li zhou
pushed into ndb-bj tree 5.1.19
[23 Aug 2007 13:10] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/32946

ChangeSet@1.2569, 2007-08-23 15:17:44+02:00, tomas@whalegate.ndb.mysql.com +1 -0
  BUG#30134 restore of backup from different endian can work for timestamp column
  (recommit for 5.1.22 target)
[23 Aug 2007 13:11] Tomas Ulin
pushed to 5.1.22 target
[23 Aug 2007 14:09] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented fix in 5.1.22 changelog (verified version with Tomas).
[24 Aug 2007 21:58] Bugs System
Pushed into 5.1.23-beta
[14 Sep 2007 16:26] Bugs System
Pushed into 5.1.23-beta