Bug #47301 Wrong error reported when attempting to drop table during backup
Submitted: 14 Sep 2009 8:23 Modified: 10 May 2016 7:09
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: CPU Architecture:Any

[14 Sep 2009 8:23] Martin Skold
Description:
Tables cannot be dropped or altered during an ongoing
backup. This is detected nad reported.
When writing testcase for bug#44695 ALTER TABLE during START BACKUP crashes mysqld
it was discovered that attempting to drop table gives wrong error.
Table is reported to be non-existing.

How to repeat:
mysql> create table t1(k int not null primary key auto_increment) engine=ndb;
Query OK, 0 rows affected (0.72 sec)

mysql> INSERT INTO t1 VALUES (NULL);
Query OK, 1 row affected (0.01 sec)

mysql> INSERT INTO t1 SELECT NULL FROM t1;
Query OK, 1 row affected (0.01 sec)
Records: 1  Duplicates: 0  Warnings: 0

repeat above
....

ndb_mgm> start backup nowait

mysql> drop table t1;
ERROR 1051 (42S02): Unknown table 't1'
mysql> show warnings;
+-------+------+-------------------------------------------------------------------------------+
| Level | Code | Message                        |
+-------+------+-------------------------------------------------------------------------------+
| Error | 1296 | Got error 761 'Unable to drop table as backup is in progress' from NDB        |
| Error |  761 | Got error 761 'Unable to drop table as backup is in progress' from NDBCLUSTER |
+-------+------+-------------------------------------------------------------------------------+
2 rows in set (0.00 sec) 

Suggested fix:
No existing error code seems apropriate,
create ER_TABLE_DROP_FAILED and return that.
Add documentation.
[14 Sep 2009 8:57] Susanne Ebrecht
Did you also test this with innodb hot backup?

Just to make sure that this is only a cluster bug and not a general bug that we have on all transactional storage engines.
[14 Sep 2009 10:23] Sveta Smirnova
Thank you for the report.

Verified as described.
[10 May 2016 7:09] Jon Stephens
Documented fix in the NDB 7.5.2 changelog, as follows:

    Trying to drop a table during an ongoing backup failed with the
    error message -Unknown table-; now, it fails with -Unable to
    alter table as backup is in progress-.

Closed.