mirror of
https://github.com/MariaDB/server.git
synced 2025-01-31 02:51:44 +01:00
Bug #18595 repeated create, insert, drop can cause MySQL table definition cache to
corrupt - add infinite retry on drop table temporary error
This commit is contained in:
parent
697db8f043
commit
7e2323ed7e
1 changed files with 27 additions and 7 deletions
|
@ -4036,20 +4036,30 @@ int ha_ndbcluster::delete_table(const char *name)
|
||||||
|
|
||||||
int ha_ndbcluster::drop_table()
|
int ha_ndbcluster::drop_table()
|
||||||
{
|
{
|
||||||
|
THD *thd= current_thd;
|
||||||
Ndb *ndb= get_ndb();
|
Ndb *ndb= get_ndb();
|
||||||
NdbDictionary::Dictionary *dict= ndb->getDictionary();
|
NdbDictionary::Dictionary *dict= ndb->getDictionary();
|
||||||
|
|
||||||
DBUG_ENTER("drop_table");
|
DBUG_ENTER("drop_table");
|
||||||
DBUG_PRINT("enter", ("Deleting %s", m_tabname));
|
DBUG_PRINT("enter", ("Deleting %s", m_tabname));
|
||||||
|
|
||||||
if (dict->dropTable(m_tabname))
|
while (dict->dropTable(m_tabname))
|
||||||
{
|
{
|
||||||
const NdbError err= dict->getNdbError();
|
const NdbError err= dict->getNdbError();
|
||||||
if (err.code == 709)
|
switch (err.status)
|
||||||
; // 709: No such table existed
|
{
|
||||||
else
|
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());
|
ERR_RETURN(dict->getNdbError());
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
release_metadata();
|
release_metadata();
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
@ -4453,14 +4463,24 @@ int ndbcluster_drop_database(const char *path)
|
||||||
List_iterator_fast<char> it(drop_list);
|
List_iterator_fast<char> it(drop_list);
|
||||||
while ((tabname=it++))
|
while ((tabname=it++))
|
||||||
{
|
{
|
||||||
if (dict->dropTable(tabname))
|
while (dict->dropTable(tabname))
|
||||||
{
|
{
|
||||||
const NdbError err= dict->getNdbError();
|
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);
|
ERR_PRINT(err);
|
||||||
ret= ndb_to_mysql_error(&err);
|
ret= ndb_to_mysql_error(&err);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DBUG_RETURN(ret);
|
DBUG_RETURN(ret);
|
||||||
|
|
Loading…
Add table
Reference in a new issue