[MDEV-23570] deprecate keep_files_on_create Created: 2020-08-25  Updated: 2022-02-01  Resolved: 2022-01-26

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Create Table
Fix Version/s: 10.8.1

Type: Task Priority: Critical
Reporter: Sergei Golubchik Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
is blocked by MDEV-11412 Ensure that table is truly dropped wh... Closed
is blocked by MDEV-17567 Atomic DDL Closed
PartOf
is part of MDEV-27373 Q1 2022 release merge Closed
Relates
relates to MDEV-23569 temporary tables can overwrite existi... Closed

 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.



 Comments   
Comment by Sergei Golubchik [ 2021-12-06 ]

pushed into preview-10.8-MDEV-23570-keep_files_on_create

Comment by Ramesh Sivaraman [ 2022-01-25 ]

ok to push

Generated at Thu Feb 08 09:23:24 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.