diff options
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r-- | sql/ha_ndbcluster.cc | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index c0eae685a52..b2f60fdaf2e 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -4036,20 +4036,30 @@ int ha_ndbcluster::delete_table(const char *name) int ha_ndbcluster::drop_table() { + THD *thd= current_thd; Ndb *ndb= get_ndb(); NdbDictionary::Dictionary *dict= ndb->getDictionary(); DBUG_ENTER("drop_table"); DBUG_PRINT("enter", ("Deleting %s", m_tabname)); - if (dict->dropTable(m_tabname)) + while (dict->dropTable(m_tabname)) { const NdbError err= dict->getNdbError(); - if (err.code == 709) - ; // 709: No such table existed - else + switch (err.status) + { + case NdbError::TemporaryError: + if (!thd->killed) + continue; // retry indefinitly + break; + default: + break; + } + if (err.code != 709) // 709: No such table existed ERR_RETURN(dict->getNdbError()); - } + break; + } + release_metadata(); DBUG_RETURN(0); } @@ -4453,14 +4463,24 @@ int ndbcluster_drop_database(const char *path) List_iterator_fast<char> it(drop_list); while ((tabname=it++)) { - if (dict->dropTable(tabname)) + while (dict->dropTable(tabname)) { const NdbError err= dict->getNdbError(); - if (err.code != 709) + switch (err.status) + { + case NdbError::TemporaryError: + if (!thd->killed) + continue; // retry indefinitly + break; + default: + break; + } + if (err.code != 709) // 709: No such table existed { ERR_PRINT(err); ret= ndb_to_mysql_error(&err); } + break; } } DBUG_RETURN(ret); |