Bug #6995 ndb_recover on varchar fields results in changing case of data
Submitted: 3 Dec 2004 18:40 Modified: 9 Dec 2004 13:09
Reporter: Ian Neubert Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S1 (Critical)
Version:4.1.7 OS:Linux (Linux 2.6.9; gcc-3.3.4)
Assigned to: Jonas Oreland CPU Architecture:Any

[3 Dec 2004 18:40] Ian Neubert
Description:
When using ndb_recover on 4.1.7 there seems to be a bug in ndb_restore (or somewhere in the backup/restore process) that converts varchar fields to be all uppercase instead of preserving the case.

How to repeat:
Very simple setup:
1 ndb_mgmd
1 ndbd
1 mysqld_safe

All on the same machine.

CREATE TABLE `shopper_id` (
  `shopper_id` varchar(32) NOT NULL default '',
  PRIMARY KEY  (`shopper_id`)
) ENGINE=ndbcluster DEFAULT CHARSET=latin1

insert into shopper_id (`shopper_id`) values('asdfASDF');

select * from shopper_id;
+------------+
| shopper_id |
+------------+
| asdfASDF   |
+------------+
1 row in set (0.00 sec)

Then I execute:
`echo "start backup" | ndb_mgm`

Then I shutdown the cluster cleanly and then bring it back up with:
`ndbd --initial`

Then I exec:
`ndb_restore -n 2 -b 1 -m BACKUP/BACKUP-1/`
`ndb_restore -n 2 -b 1 -r BACKUP/BACKUP-1/`

Then back in mysql:
select * from shopper_id;
+------------+
| shopper_id |
+------------+
| ASDFASDF   |
+------------+
1 row in set (0.00 sec)

Thats not good. 

Here is my config.ini:

[NDBD DEFAULT]
NoOfReplicas= 1
MaxNoOfOrderedIndexes= 2048
MaxNoOfUniqueHashIndexes= 1024
MaxNoOfTables= 800
MaxNoOfAttributes= 2000

[MYSQLD DEFAULT]
[NDB_MGMD DEFAULT]
[TCP DEFAULT]

[NDB_MGMD]
HostName= localhost

[NDBD]
HostName= localhost
DataDir= /var/lib/mysql-cluster

[MYSQLD]
[MYSQLD]
[MYSQLD]

Suggested fix:
Backup and restore functions should not change case of data.
[9 Dec 2004 13:09] Jonas Oreland
Fixed.

Will be in 4.1.8