Details
-
Task
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
None
Description
MyISAM/Aria traditionally overwrite files on CREATE TABLE. That is, if tablename.MYI file or tablename.MYD or .MAI or .MAD exists, it'll be silently overwritten.
Presumably, it was done because there was no way to get rid of orphan MyISAM/Aria files otherwise.
This can be dangerous and cause the data loss. As a fix a new sysvar keep_files_on_create was introduced in 2007. If set, MyISAM/Aria will error out if a conflicting file exists.
Now in MDEV-11412 the server has got a way to delete orphan files. And after MDEV-17567 orphan files should never happen at all without manual tinkering with the datadir.
This means we could safely deprecate and then remove both the overwriting behavior and keep_files_on_create, making MyISAM/Aria to always return an error, if a conflicting file exists.
Additionally, the overwrite check could be optimized. Now (see my_create_with_symlink()) it costs one or two access() calls to see whether a confliciting file exists. Instead it should set O_EXCL and rely on create() to return an error.
Attachments
Issue Links
- is blocked by
-
MDEV-11412 Ensure that table is truly dropped when using DROP TABLE
- Closed
-
MDEV-17567 Atomic DDL
- Closed
- is part of
-
MDEV-27373 Q1 2022 release merge
- Closed
- relates to
-
MDEV-23569 temporary tables can overwrite existing files
- Closed