Bug #47301 Wrong error reported when attempting to drop table during backup
Submitted: 14 Sep 10:23 Modified: 14 Sep 12:23
Reporter: Martin Skold
Status: Verified
Category:Server: Cluster Severity:S3 (Non-critical)
Version:mysql-5.1-telco-6.2 OS:Any
Assigned to: Target Version:
Triage: Triaged: D4 (Minor) / R2 (Low) / E3 (Medium)

[14 Sep 10: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 10: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 12:23] Sveta Smirnova
Thank you for the report.

Verified as described.