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

mysqldump sets system_versioning_insert_history=1 twice and doesn't restore previous value

    XMLWordPrintable

Details

    Description

      Usually mysqldump stores session variable values before changing them, and restores later.

      With system_versioning_insert_history, it behaves differently. It sets it to 1 before dumping contents of each versioned table, without storing the previous value, and then sets it to 1 again after dumping the contents. So, it's two SET system_versioning_insert_history=1 per each versioned table. Even if not storing/restoring the previous value is intentional, the second SET is redundant.

      create table t1 (a int) with system versioning;
      insert into t1 values (1);
       
      --let $datadir=`select @@datadir`
      --exec $MYSQL_DUMP --dump-history test
       
      # Cleanup
      drop table t1;
      

      bb-10.11-MDEV-16546 2b1d324294

      /*!101100 SET system_versioning_insert_history=1 */;
      LOCK TABLES `t1` WRITE;
      /*!40000 ALTER TABLE `t1` DISABLE KEYS */;
      INSERT INTO `t1` (`a`, row_start, row_end) VALUES (1,'2022-10-07 12:22:46.461328','2038-01-19 03:14:07.999999');
      /*!40000 ALTER TABLE `t1` ENABLE KEYS */;
      UNLOCK TABLES;
      /*!101100 SET system_versioning_insert_history=1 */;
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 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.