Below is the list of changes that have just been committed into a local
5.1 repository of mskold. When mskold does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2008-05-27 16:12:38+02:00, mskold@stripped +1 -0
bug#37000 Dropping table when ndb is in single user mode incorrectly deletes .ndb file: Only call handler::delete_table if no error or if table already gone
sql/ha_ndbcluster.cc@stripped, 2008-05-27 16:11:48+02:00, mskold@stripped +25 -5
bug#37000 Dropping table when ndb is in single user mode incorrectly deletes .ndb file: Only call handler::delete_table if no error or if table already gone
diff -Nrup a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc
--- a/sql/ha_ndbcluster.cc 2008-04-09 17:29:39 +02:00
+++ b/sql/ha_ndbcluster.cc 2008-05-27 16:11:48 +02:00
@@ -6324,6 +6324,8 @@ retry_temporary_error1:
int ha_ndbcluster::delete_table(const char *name)
{
THD *thd= current_thd;
+ Ndb *ndb;
+ int error= 0;
DBUG_ENTER("ha_ndbcluster::delete_table");
DBUG_PRINT("enter", ("name: %s", name));
set_dbname(name);
@@ -6338,17 +6340,35 @@ int ha_ndbcluster::delete_table(const ch
{
DBUG_PRINT("info", ("Schema distribution table not setup"));
DBUG_ASSERT(ndb_schema_share);
- DBUG_RETURN(HA_ERR_NO_CONNECTION);
+ error= HA_ERR_NO_CONNECTION;
+ goto err;
}
#endif
if (check_ndb_connection(thd))
- DBUG_RETURN(HA_ERR_NO_CONNECTION);
+ {
+ error= HA_ERR_NO_CONNECTION;
+ goto err;
+ }
- /* Call ancestor function to delete .ndb file */
- handler::delete_table(name);
+ ndb= get_ndb(thd);
+ /*
+ Drop table in ndb.
+ If it was already gone it might have been dropped
+ remotely, give a warning and then drop .ndb file.
+ */
+ if (!(error= delete_table(thd, this, ndb, name,
+ m_dbname, m_tabname)) ||
+ error == HA_ERR_NO_SUCH_TABLE)
+ {
+ /* Call ancestor function to delete .ndb file */
+ int error1= handler::delete_table(name);
+ if (!error)
+ error= error1;
+ }
- DBUG_RETURN(delete_table(thd, this, get_ndb(thd), name, m_dbname, m_tabname));
+err:
+ DBUG_RETURN(error);
}
| Thread |
|---|
| • bk commit into 5.1 tree (mskold:1.2603) BUG#37000 | Martin Skold | 27 May |