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

System versioning setting to allow history modification

    XMLWordPrintable

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

            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.