Bug #37000 Dropping table when ndb is in single user mode incorrectly deletes .ndb file
Submitted: 27 May 2008 9:43 Modified: 30 May 2008 14:21
Reporter: Martin Skold Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:mysql-5.1-telco-6.2 OS:Any
Assigned to: Martin Skold CPU Architecture:Any

[27 May 2008 9:43] Martin Skold
Description:
If dropping a table fails for any reason, such as when in
single user mode, then the .ndb file is still removed.

How to repeat:
Start cluster with two connected mysqld's.
server1:
 mysql> create table t1 (a int key, b int unique, c int) engine ndb;
Query OK, 0 rows affected (2.19 sec)
ndb_mgm:
 ndb_mgm> ENTER SINGLE USER MODE 4
 Single user mode entered
 Access is granted for API node 4 only.
server2:
 mysql> drop table t1;
 ERROR 1051 (42S02): Unknown table 't1'

t1.ndb is missing on server2

Suggested fix:
Don't delete .ndb file in case of errors
[27 May 2008 9:46] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/47068

ChangeSet@1.2603, 2008-05-27 11:45:26+02:00, mskold@mysql.com +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
[27 May 2008 13:22] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/47082

ChangeSet@1.2604, 2008-05-27 15:21:44+02:00, mskold@mysql.com +1 -0
  bug#37000 Dropping table when ndb is in single user mode incorrectly deletes .ndb file: If table already gone then remove .ndb filer
[27 May 2008 13:31] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/47083

ChangeSet@1.2605, 2008-05-27 15:30:07+02:00, mskold@mysql.com +1 -0
  bug#37000 Dropping table when ndb is in single user mode incorrectly deletes .ndb file: Updated incorrect result
[27 May 2008 13:34] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/47084

ChangeSet@1.2603, 2008-05-27 15:33:29+02:00, mskold@mysql.com +2 -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
[27 May 2008 14:13] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/47085

ChangeSet@1.2603, 2008-05-27 16:12:38+02:00, mskold@mysql.com +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
[27 May 2008 14:17] Bugs System
Pushed into 5.1.24-ndb-6.2.16
[27 May 2008 14:27] Bugs System
Pushed into 5.1.24-ndb-6.3.15
[27 May 2008 19:58] Bugs System
Pushed into 5.1.23-ndb-6.4.0
[30 May 2008 14:21] Jon Stephens
Documetned in the 5.1.24-ndb-6.2.16 and 5.1.24-ndb-6.3.15 changelogs as follows:

        When dropping a table failed for any reason (such as when in
        single user mode) then the corresponding <filename>.ndb</filename> file
        was still removed.
[12 Dec 2008 23:28] Bugs System
Pushed into 6.0.6-alpha  (revid:sp1r-mskold/marty@mysql.com/quadfish.(none)-20080527141238-23575) (version source revid:jonas@mysql.com-20080808094047-4e1yiarqa2t3opg3) (pib:5)