Bug #41604 handlerton::drop_database should allow return value
Submitted: 18 Dec 2008 21:00 Modified: 27 Dec 2010 13:38
Reporter: Tim Clark Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Storage Engine API Severity:S4 (Feature request)
Version:5.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: drop_database, handlerton

[18 Dec 2008 21:00] Tim Clark
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);
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.
[27 Dec 2010 13:38] Valeriy Kravchuk
Thank you for the feature request.