Description:
MySQL 5.0 returns a generic ER_BAD_TABLE_ERROR when running DROP TABLE on a known NDBCLUSTER table during a node restart, due to schema operation being disallowed at this time. ER_BAD_TABLE_ERROR results in a generic and misleading error message for this situation:
"ERROR 1051 (42S02): Unknown table '<ndb_table>'"
The user must know to issue SHOW WARNINGS to get further information:
"Got error 701 'System busy with other schema operation' from ndbcluster"
A possibly a related change in MySQL 5.1: MySQL apparently now blocks for a while until the schema operation can complete. This behavior seems less appropriate than returning an error, and equally non-intuitive.
How to repeat:
Issue "DROP TABLE <ndb_table>" on a MySQL node while a data node is restarting.
Suggested fix:
While is it expected that schema operations are disabled during a node restart, it would be nice to have a server error code that recognizes this situation, particularly as MySQL does know about this table being dropped via a local .frm.
We already have special server error codes for failure of schema operations on other storage engines, eg: ER_CANT_CREATE_FEDERATED_TABLE
How about something like ER_NDB_BUSY_WITH_SCHEMA_OPS to handle both CREATE TABLE and DROP TABLE for cluster as appropriate?