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

AUTO_INCREMENT column gets unexpected value after INSERT -2

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.4.13, 10.5.4
    • Fix Version/s: None
    • Component/s: Data types
    • Labels:
      None
    • Environment:
      Linux Debian 10 x86_64

      Description

      After inserting negative -2 in an auto-incremented column, the new generated serial jumps from 1 to 3, when it should be 2, according to the documentation:

      https://mariadb.com/kb/en/auto_increment/#setting-explicit-values

      The doc shows examples with positive values, but there is a clear sentence:

      If the new value is lower than the current maximum value, the AUTO_INCREMENT value remains unchanged.

      Which should include negative explicit values ...

        Attachments

        1. config.txt
          19 kB
        2. serial.sql
          0.6 kB

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            sebflaesch FLAESCH Sebastien
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration