Bug #47289 ndb_restore can crash if a hidden blob table is missing
Submitted: 13 Sep 2009 9:09 Modified: 5 Dec 2009 9:39
Reporter: Andrew Hutchings Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:mysql-5.1-telco-7.0 OS:Any
Assigned to: Frazer Clement CPU Architecture:Any
Tags: 7.0.5

[13 Sep 2009 9:09] Andrew Hutchings
Description:
If a hidden blob table is missing from a backup ndb_restore can seg fault on the following line in RestoreMetaData::fixBlobs():

NdbTableImpl& bt = NdbTableImpl::getImpl(*blobTable->m_dictTable);

This is because blobTable is NULL.

How to repeat:
Not sure how to create a backup with a missing hidden blob table yet, still working on that

Suggested fix:
Change the following to an error instead in RestoreMetaData::fixBlobs():

assert(blobTable != NULL);
[21 Sep 2009 18:39] Jonas Oreland
Possibly... http://bugs.mysql.com/bug.php?id=46873 could be cause
[24 Nov 2009 17:19] Frazer Clement
Proposed patch

Attachment: bug47289.patch (text/x-patch), 867 bytes.

[24 Nov 2009 17:21] Frazer Clement
Verified by manually deleting blob parts table before backup.

On restore of metadata, fact that blob parts table is missing now results in error rather than assertion failure.
[24 Nov 2009 18:43] MySQL Verification Team
i studied the original core file for this crash, and iirc it wasn't asserting because the assertions weren't compiled into the binary!  it really was crashing, not asserting.
[24 Nov 2009 18:54] Andrew Hutchings
Shane: sure, but the crash and assert are for the same reason.  Without the assert there is the assumption that it has obtained a pointer to the hidden blob table where it really hasn't.  Hence the crash you observed.
[2 Dec 2009 14:51] 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/92469

3041 Frazer Clement	2009-12-02
      Bug#47289 ndb_restore can crash if a hidden blob table is missing
      modified:
        storage/ndb/tools/restore/Restore.cpp
[2 Dec 2009 15:15] Bugs System
Pushed into 5.1.39-ndb-7.0.10 (revid:frazer@mysql.com-20091202150119-0muuth024en2vgqx) (version source revid:frazer@mysql.com-20091202150119-0muuth024en2vgqx) (merge vers: 5.1.39-ndb-7.0.10) (pib:13)
[2 Dec 2009 15:15] Bugs System
Pushed into 5.1.39-ndb-7.1.0 (revid:frazer@mysql.com-20091202150444-k0fur6rk9mhj8eho) (version source revid:frazer@mysql.com-20091202150444-k0fur6rk9mhj8eho) (merge vers: 5.1.39-ndb-7.1.0) (pib:13)
[2 Dec 2009 15:17] Bugs System
Pushed into 5.1.39-ndb-6.3.29 (revid:frazer@mysql.com-20091202145401-iksg0hh0c9yu8dua) (version source revid:frazer@mysql.com-20091202145401-iksg0hh0c9yu8dua) (merge vers: 5.1.39-ndb-6.3.29) (pib:13)
[2 Dec 2009 15:57] Frazer Clement
Pushed to 6.2.19, 6.3.29, 7.0.10, 7.1.0
[5 Dec 2009 9:39] Jon Stephens
Documented bugfix in the NDB-6.2.19, 6.3.29, and 7.0.10 changelogs, as follows:

        NDB stores blob column data in a separate table that is not
        accessible from MySQL. If this table was missing for some reason
        (such as accidental deletion of the file corresponding to the
        hidden table) when making a MySQL Cluster native backup,
        ndb_restore crashed when attempting to restore the backup. Now
        in such cases, ndb_restore fails with the error message *Table
        table_name has blob column (column_name) with missing parts
        table in backup* instead.

Closed.