Bug #43409 ndb_restore* tests fail on big endian architectures(PowerPC, Sparc)
Submitted: 5 Mar 2009 11:16 Modified: 9 Jan 2015 14:37
Reporter: Martin Skold Email Updates:
Status: Won't fix Impact on me:
None 
Category:Tests: Cluster Severity:S3 (Non-critical)
Version:mysql-5.1-telco-6.3, mysql-6.0-telco-6.4 OS:Any (big-endian)
Assigned to: CPU Architecture:Any
Triage: Triaged: D4 (Minor)

[5 Mar 2009 11:16] Martin Skold
Description:
ndb_restore, ndb_restore_compat and ndb_restore_compressed use
the CHECKSUM table reauture. This does a crc2 calculation over
each physical record and is thus byte order dependent.

How to repeat:
Run ndb_restore test on Sparc.

Suggested fix:
Implement a byte order independent ha_ndbcluster::checksum() function.
[6 Mar 2009 9:05] Sveta Smirnova
Thank you for the report.

Verified as described.
[6 Mar 2009 13:48] Joerg Bruehe
The tests "ndb_restore" and "ndb_restore_compressed"
currently (= in 6.3.23) include a "checksum" call,
this is how their failure starts on a big-endian machine (Sparc64, running Solaris 10):

=====
ndb.ndb_restore                          [ fail ]
        Test ended at YYYY-MM-DD HH:MM:SS

CURRENT_TEST: ndb.ndb_restore
--- /PATH/mysql-test/suite/ndb/r/ndb_restore.result
+++ /PATH/mysql-test/suite/ndb/r/ndb_restore.reject
@@ -613,10 +613,10 @@
 (7, "Highlea", 7, repeat("U", 1000));
 checksum table tab1;
 Table  Checksum
-db1.tab1       994088853
+db1.tab1       1979193300
 checksum table tab2;
 Table  Checksum
-db1.tab2       1516475923
+db1.tab2       1411875553
 use db2;
 create table tab1 (a int primary key) engine=ndb;
 create table tab2 (a int primary key, b varchar(20), c int, unique(c), d text) engine=ndb;
@@ -624,10 +624,10 @@
 insert into tab2 select * from db1.tab2;
 checksum table tab1;
 Table  Checksum
-db2.tab1       994088853
+db2.tab1       1979193300
 checksum table tab2;
 Table  Checksum
-db2.tab2       1516475923
+db2.tab2       1411875553
 ***********************
 Backing up created data
 ***********************
...
=====
[10 Mar 2009 12:48] 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/68758

2899 Martin Skold	2009-03-10
      Bug #43409  ndb_restore* tests fail on big endian architectures(PowerPC, Sparc): removed use of checksum
      modified:
        mysql-test/suite/ndb/r/ndb_restore.result
        mysql-test/suite/ndb/r/ndb_restore_compressed.result
        mysql-test/suite/ndb/t/ndb_restore.test
[10 Mar 2009 13:34] Bugs System
Pushed into 5.1.32-ndb-6.4.4 (revid:martin.skold@mysql.com-20090310133128-m5jm2ytswx1hnc08) (version source revid:martin.skold@mysql.com-20090310133128-m5jm2ytswx1hnc08) (merge vers: 5.1.32-ndb-6.4.4) (pib:6)
[10 Mar 2009 13:36] Bugs System
Pushed into 5.1.32-ndb-6.3.24 (revid:martin.skold@mysql.com-20090310133522-b8bb9n52eqfwpq6x) (version source revid:martin.skold@mysql.com-20090310124530-wjh2gt84lujcf7q3) (merge vers: 5.1.32-ndb-6.3.24) (pib:6)
[10 Mar 2009 13:38] 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/68765

2922 Martin Skold	2009-03-10 [merge]
      Merge
      modified:
        mysql-test/suite/ndb/r/ndb_restore.result
        mysql-test/suite/ndb/r/ndb_restore_compressed.result
        mysql-test/suite/ndb/t/ndb_restore.test