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

SHOW CREATE SEQUENCE to output restart value

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Fix Version/s: N/A
    • Component/s: Sequences
    • Labels:
      None

      Description

      When a user is restoring from a mysqldump, or looking at a galera node previously ssted from a mysqldump sst, we really don't want them panicing that they are missing data that is derived from sequences.

      Anel Husakovic's current work has placed the `CREATE SEQUENCES` at the end of the mysqldump, so regardless if its dumped with `--single-transaction` or not, the `show create sequence` at the time its executated will contain a usable sequnce number.

      Rather than the original plan of extending `create sequence`, `show create sequence` can return a `setval(seq, nextnum)` as follows:

      proposed SHOW CREATE SEQUENCE results

      | s     | CREATE SEQUENCE `s` start with 100 minvalue 1 maxvalue 9223372036854775806 increment by 10 cache 1000 nocycle ENGINE=InnoDB |
      | s     | SELECT SETVAL(`s`, 1024)                                                                                                  |
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serg Sergei Golubchik
              Reporter:
              danblack Daniel Black
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration