summaryrefslogtreecommitdiff
path: root/sql/ha_ndbcluster.cc
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2006-06-14 12:54:28 +0200
committerunknown <tomas@poseidon.ndb.mysql.com>2006-06-14 12:54:28 +0200
commit234de474750c637f4b9d6f609af94e10ccaf3a42 (patch)
treeda8ca04dfe8820694ca758cb555b229404bde2c5 /sql/ha_ndbcluster.cc
parent40d687eb43cbc12b67ce65bd3bf8566baee897ac (diff)
downloadmariadb-git-234de474750c637f4b9d6f609af94e10ccaf3a42.tar.gz
Bug #18595 repeated create, insert, drop can cause MySQL table definition cache to
corrupt - add infinite retry on drop table temporary error
Diffstat (limited to 'sql/ha_ndbcluster.cc')
-rw-r--r--sql/ha_ndbcluster.cc34
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);