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

mysqldump will forget sequence definition details on --no-data dump

    XMLWordPrintable

Details

    Description

      How to reproduce:

      • create a sequence that uses many optional settings, like:

      CREATE SEQUENCE s START WITH 100 INCREMENT BY 10 MINVALUE=100 MAXVALUE=1000 CYCLE;
      

      Dump and restore it with regular mysqldump, and do SHOW CREATE SEQUENCE s:

      MariaDB [test]> show create sequence s;
      +-------+--------------------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                                 |
      +-------+--------------------------------------------------------------------------------------------------------------+
      | s     | CREATE SEQUENCE `s` start with 100 minvalue 100 maxvalue 1000 increment by 10 cache 1000 cycle ENGINE=InnoDB |
      +-------+--------------------------------------------------------------------------------------------------------------+
      1 row in set (0.001 sec)
      

      So the sequence was restored perfectly. Now lets try the same with a --no-data dump:

      MariaDB [test]> show create sequence s;
      +-------+--------------------------------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                                             |
      +-------+--------------------------------------------------------------------------------------------------------------------------+
      | s     | CREATE SEQUENCE `s` start with 1 minvalue 1 maxvalue 9223372036854775806 increment by 1 cache 1000 nocycle ENGINE=InnoDB |
      +-------+--------------------------------------------------------------------------------------------------------------------------+
      1 row in set (0.001 sec)
      

      Now the sequence was recreated completely differently, only its name was preserved, and the CACHE value matches by chance as the original create didn't specify that one, so that it was using the default.

      Attachments

        Issue Links

          Activity

            People

              anel Anel Husakovic
              hholzgra Hartmut Holzgraefe
              Votes:
              0 Vote for this issue
              Watchers:
              10 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.