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

ATOMIC CREATE VIEW

    XMLWordPrintable

Details

    Description

      The purpose of this task is to ensure that CREATE VIEW is atomic

      When a view is created, the definition is first written to a view_name.frm~ and then renamed to
      view_name.frm

      The logic should be

      • Log CREATE view to DDL log, with a marker if old view existsted
      • If old view exists (in case of CREATE or REPLACE view) make a copy of old view
      • Create view
      • Delete view copy if it was created.

      Crash recovery:

      • Delete view_name.frm~ file.
      • If query was logged to binary log
      • delete copy of view if it exists
        -else
        rename the copy of the view over the .frm file (restoring old definition)

      One benefit of the new code is that create or replace view is no totally atomic even if there existed an old view: Either the view will be replaced or the old one will be untouched.

      Attachments

        Issue Links

          Activity

            People

              monty Michael Widenius
              monty Michael Widenius
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.