All DDL operations must be atomic before we can really claim to support Atomic DDL (
DROP DATABASE was only made crash-safe in
MDEV-24408; it is not atomic yet. With the following approach, it should become atomic on XA-capable storage engines:
An atomic implementation of DROP DATABASE would involve the following internal steps:
- XA START
- For each table in storage engines, invoke handler::delete_table().
- If everything succeeded, invoke handlerton::drop_database in each storage engine that implements it.
- XA PREPARE in each storage engine
- XA COMMIT or XA ROLLBACK in each storage engine.