Description:
The drop_database function defined by the handlerton should allow the storage engine implementation to return an integer value. A non-zero value should cause the DROP SCHEMA operation to fail.
This is necessary for storage engines which may encounter an error during the drop_database execution. An example of such an engine is the IBMDB2I plugin, currently under development. Under certain conditions, metadata in the implemented schema may not be cleanly removed. Since the engine cannot report this to MySQL, MySQL continues and removes the schema from its knowledge. If the schema is recreated, an attempt to create an IBMDB2I table in the schema will fail until the user manually intervenes to clean up the metadata.
How to repeat:
See description
Suggested fix:
Change handler.h:
void (*drop_database)(handlerton *hton, char* path);
to
int (*drop_database)(handlerton *hton, char* path);
and change all callers to notice the return value and fail the operation if it is not 0.