Bug #37171 ndb_restore --print-data garbles DECIMAL data
Submitted: 3 Jun 2008 21:11 Modified: 13 Apr 2009 15:51
Reporter: Axel Schwenke Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:5.0.64-bk, 5.1.25-bk OS:Any
Assigned to: Frazer Clement CPU Architecture:Any

[3 Jun 2008 21:11] Axel Schwenke
Description:
ndb_restore --print-data (and friends) garbles data from DECIMAL columns. Normal restore operation is not affected.

How to repeat:
(start single node cluster with default settings)

mysql> create table t1 (id serial, val decimal(12,4)) engine ndbcluster;
Query OK, 0 rows affected (1,91 sec)

mysql> insert into t1 (val) values (0.0100), (12.3456), (42.0000), (4711.0815);
Query OK, 4 rows affected (0,00 sec)
Records: 4  Duplicates: 0  Warnings: 0

mysql> select * from t1;
+----+-----------+
| id | val       |
+----+-----------+
|  1 |    0.0100 | 
|  3 |   42.0000 | 
|  4 | 4711.0815 | 
|  2 |   12.3456 | 
+----+-----------+
4 rows in set (0,01 sec)

ndb_mgm> start backup
Waiting for completed, this may take several minutes
Node 2: Backup 1 started from node 1
Node 2: Backup 1 started from node 1 completed
 StartGCP: 68 StopGCP: 71
 #Records: 2060 #LogRecords: 0
 Data: 34584 bytes Log: 0 bytes

$ndb_restore -n 2 -b 1 --print-data var2/BACKUP/BACKUP-1/ test t1
Nodeid = 2
Backup Id = 1
backup path = var2/BACKUP/BACKUP-1/
Restoring only from database test
Restoring only tables: t1
Ndb version in backup files: Version 5.1.25
_____________________________________________________
Processing data in table: sys/def/NDB$EVENTS_0(1) fragment 0
_____________________________________________________
Processing data in table: mysql/def/ndb_apply_status(4) fragment 0
_____________________________________________________
Processing data in table: test/def/t1(5) fragment 0
1       29
2       29
3       29
4       29
_____________________________________________________
Processing data in table: mysql/def/NDB$BLOB_2_3(3) fragment 0
_____________________________________________________
Processing data in table: sys/def/SYSTAB_0(0) fragment 0
_____________________________________________________
Processing data in table: mysql/def/ndb_schema(2) fragment 0

NDBT_ProgramExit: 0 - OK
[7 Apr 2009 15:01] Frazer Clement
Proposed patch against mysql-5.1-telco-6.2

Attachment: bug37171.patch (text/x-patch), 8.07 KiB.

[8 Apr 2009 22:24] 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/71691

2903 Frazer Clement	2009-04-08
      Bug#37171 : Fix to bug fix
      modified:
        storage/ndb/src/ndbapi/NdbRecAttr.cpp
[8 Apr 2009 22:32] Bugs System
Pushed into 5.1.32-ndb-7.0.5 (revid:frazer@mysql.com-20090408222804-ve6xi3f1gaunzzxy) (version source revid:frazer@mysql.com-20090408222804-ve6xi3f1gaunzzxy) (merge vers: 5.1.32-ndb-7.0.5) (pib:6)
[8 Apr 2009 22:32] Bugs System
Pushed into 5.1.32-ndb-6.2.18 (revid:frazer@mysql.com-20090408222322-q552yf2q8iu2bbpc) (version source revid:frazer@mysql.com-20090408222322-q552yf2q8iu2bbpc) (merge vers: 5.1.32-ndb-6.2.18) (pib:6)
[8 Apr 2009 22:33] Bugs System
Pushed into 5.1.32-ndb-6.3.25 (revid:frazer@mysql.com-20090408222513-d9ddlkxomto876ld) (version source revid:frazer@mysql.com-20090408222513-d9ddlkxomto876ld) (merge vers: 5.1.32-ndb-6.3.25) (pib:6)
[13 Apr 2009 15:51] Jon Stephens
Documented bugfix in the NDB-6.2.18, 6.3.25, and 7.0.5 changelogs as follows:

        ndb_restore --print_data did not handle DECIMAL columns correctly.