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

More robust way to switch table names

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      Sometimes it happens to replace a table with a new version, and still want to preserve the old table in the db (so it can be quickly restored if needed). In production, we do:

      RENAME TABLE
          tab1 TO tmp_tab,
          tab2 TO tab1,
          tmp_tab TO tab2;
      

      If tmp_tab exists, we get an error: this is expected but still annoying when you are doing some massive operation. It would be desirable that the optimiser understands that any free name is equally acceptable, as long as RENAME TABLE ends with the expected result or no change at all.

      Attachments

        Activity

          People

            Unassigned Unassigned
            f_razzoli Federico Razzoli
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.