Bug #27758 NDB tables with index names containing spaces not restored correctly
Submitted: 11 Apr 2007 17:05 Modified: 17 Apr 2007 13:31
Reporter: Geert Vanderkelen
Status: Closed
Category:Server: Cluster Severity:S2 (Serious)
Version:5.0.38 OS:Linux
Assigned to: Tomas Ulin Target Version:
Tags: ndb, Backup, ndb_restore, indexes, keys, spaces

[11 Apr 2007 17:05] Geert Vanderkelen
Description:
A NDB backup made from 5.0.30 and restoring it into 5.0.38 makes 1 particular table makes
it broken on the SQL node. It fails in all the databases it was created in.

Checking the table in question using ndb_desc or ndb_select_count, all seems fine. When
doing any operation in the MySQL server on this table, following error is returned:

mysql> DESC t1;
ERROR 1296 (HY000): Got error 1 'Unknown error code' from ndbcluster
mysql> SHOW WARNINGS;
+-------+------+---------------+
| Level | Code | Message       |
+-------+------+---------------+
| Error | 1105 | Unknown error | 
+-------+------+---------------+

Removing the .frm/.ndb files and letting it rediscover does not work. Also, it happens on
all SQL nodes connect at the same time.

How to repeat:
Repeatable test case (backup) available privately, together with more information and
about table structure.
Restoring it to 5.0.30 gives same problems.
[11 Apr 2007 17:14] Geert Vanderkelen
Verified using MySQL 5.0.30 and 5.0.38.
[12 Apr 2007 8:32] Tomas Ulin
Problem found.

The problem is the key including a space `product type`

When restored from the ndb_restore the key becomes named `product`...

Workaround:  Don't use key's with spaces.

BR,

Tomas
[12 Apr 2007 10:53] 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/24367

ChangeSet@1.2446, 2007-04-12 11:07:30+02:00, tomas@whalegate.ndb.mysql.com +5 -0
  Bug #27758 Restoring NDB backups makes table usable in SQL nodes
  - parse indexname using "split" instead of sscanf, as not to break at space
  - test case with space in key
  - enclose names in printout
[15 Apr 2007 18:48] Bugs System
Pushed into 5.1.18-beta
[15 Apr 2007 18:53] Bugs System
Pushed into 5.0.40
[17 Apr 2007 13:31] 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 bugfix in 5.0.40 and 5.1.18 changelogs.

Updated synopsis and tags to reflect actual source of problem.