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

System versioning setting to allow history modification

Details

    Description

      Add a session server variable @@system_versioning_insert_history which allows to use ROW_START and ROW_END columns in the INSERT (unless they are normal visible (in SELECT *) fields, they have to be explicitly specified in INSERT as any invisible fields are). And if @@secure_timestamp allows the current user to modify @@timestamp then he should be able to insert directly into ROW_START/ROW_END columns.

      The use case of this is to be able to dump the history with mysqldump and to load it back later (MDEV-16029). It provides a convenient way to have a row in the system versioned table with row_start=A and row_end=B. Without @@system_versioning_insert_history it can be achieved with

      set @@timestamp=A;
      insert t1 values (...);
      set @@timestamp=B;
      delete from t1 where ... -- a condition to match the row that was just inserted
      

      So this new feature does not provide any new functionality, but allows to load the history dump much faster than with timestamp manipulations as above. In particular it does not allow to do anything that wasn't possible to do before, it requires exactly the same set of privileges as the snippet above, and is subject to the same set of restrictions.

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Aleksey Midenkov made transition -
            Open In Progress
            5m 46s 1
            Aleksey Midenkov made transition -
            Stalled In Progress
            319d 4h 42m 5
            Aleksey Midenkov made transition -
            In Progress In Review
            41d 20h 58m 6
            Sergei Golubchik made transition -
            In Review Stalled
            1186d 4h 49m 6
            Sergei Golubchik made transition -
            Stalled In Review
            14h 38m 1
            Sergei Golubchik made transition -
            In Review In Testing
            1d 5h 3m 1
            Elena Stepanova made transition -
            In Testing Stalled
            33d 9h 17m 1
            Sergei Golubchik made transition -
            Stalled Closed
            5d 16h 55m 1

            People

              serg Sergei Golubchik
              midenok Aleksey Midenkov
              Votes:
              8 Vote for this issue
              Watchers:
              17 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.