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

Atomic CREATE OR REPLACE TABLE

    XMLWordPrintable

Details

    Description

      Atomic drop table (MDEV-23844) does not recover the replaced table if CREATE OR REPLACE TABLE fails.

      This is because current, as before, CREATE OR REPLACE TABLE foo ... is implemented as:

      DROP TABLE IF EXISTS foo;
      CREATE TABLE foo ..

      Because of that failed CREATE OR REPLACE TABLE or a crash during the create will lead to lost table, if the original table existed.

      This task equips table drop with backing up the old table until the new table was successfully created.

      In other words, this task ensures that if one executes CREATE OR REPLACE TABLE foo on an existing table, the table foo will either be the new or old table after the statement has executed, including in the cases the CREATE fails or the server crashes.

      NOTE: this change was in a preview release for MariaDB Community Server 10.10.0, but could not be added to 10.10 RC

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              midenok Aleksey Midenkov
              Votes:
              1 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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