Bug #47289 ndb_restore can crash if a hidden blob table is missing
Submitted: 13 Sep 11:09 Modified: 24 Nov 18:21
Reporter: Andrew Hutchings
Status: Patch pending
Category:Server: Cluster Severity:S2 (Serious)
Version:mysql-5.1-telco-7.0 OS:Any
Assigned to: Frazer Clement Target Version:
Tags: 7.0.5
Triage: Triaged: D2 (Serious) / R6 (Needs Assessment) / E6 (Needs Assessment)

[13 Sep 11: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 20:39] Jonas Oreland
Possibly... http://bugs.mysql.com/bug.php?id=46873 could be cause
[24 Nov 18:19] Frazer Clement
Proposed patch

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

[24 Nov 18: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 19:43] Shane Bester
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 19: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.