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

AUTO_INCREMENT column gets unexpected value after INSERT -2

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.4.13, 10.5.4
    • None
    • Data types
    • None
    • 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
          FLAESCH Sebastien
        2. serial.sql
          0.6 kB
          FLAESCH Sebastien

        Activity

          People

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

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.