Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-23570

deprecate keep_files_on_create

    XMLWordPrintable

Details

    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

          Activity

            People

              bar Alexander Barkov
              serg Sergei Golubchik
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.