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

2. auto_increment_increment and auto_increment_offset reset to 1 in current session after alter table on auto-increment column

Details

    Description

      Hi,

      We encounter sequence object issue as MDEV-27120. Then, trying to set

      wsrep_auto_increment_control=OFF
      auto_increment_increment=3
      auto_increment_offset=1|2|3
      

      However, got another issue in another application using auto-increment.
      auto_increment_increment and auto_increment_offset reset to 1 in current session after alter table with auto-increment column. Reconnect DB will get back correct setting.

      Below see below example:

      MariaDB [testdb1]> show variables like 'auto_increment%' ;
      +--------------------------+-------+
      | Variable_name            | Value |
      +--------------------------+-------+
      | auto_increment_increment | 3     |
      | auto_increment_offset    | 2     |
      +--------------------------+-------+
      2 rows in set (0.001 sec)
       
      MariaDB [testdb1]>
      MariaDB [testdb1]>
      MariaDB [testdb1]> create table t4 (c1 int primary key auto_increment) ;
      Query OK, 0 rows affected (0.009 sec)
       
      MariaDB [testdb1]>
      MariaDB [testdb1]>
      MariaDB [testdb1]> show variables like 'auto_increment%' ;
      +--------------------------+-------+
      | Variable_name            | Value |
      +--------------------------+-------+
      | auto_increment_increment | 3     |
      | auto_increment_offset    | 2     |
      +--------------------------+-------+
      2 rows in set (0.001 sec)
       
      MariaDB [testdb1]>
      MariaDB [testdb1]>
      MariaDB [testdb1]> alter table t4 add (c2 varchar(50)) ;
      Query OK, 0 rows affected (0.006 sec)
      Records: 0  Duplicates: 0  Warnings: 0
       
      MariaDB [testdb1]>
      MariaDB [testdb1]>
      MariaDB [testdb1]> show variables like 'auto_increment%' ;
      +--------------------------+-------+
      | Variable_name            | Value |
      +--------------------------+-------+
      | auto_increment_increment | 1     |
      | auto_increment_offset    | 1     |
      +--------------------------+-------+
      2 rows in set (0.001 sec)
       
      MariaDB [testdb1]>
      MariaDB [testdb1]>
      MariaDB [testdb1]>
      

      Attachments

        Activity

          frelist William Wong created issue -
          serg Sergei Golubchik made changes -
          Field Original Value New Value
          Description Hi,

          We encounter sequence object issue as MDEV-27120. Then, trying to set
          wsrep_auto_increment_control=OFF
          auto_increment_increment=3
          auto_increment_offset=1|2|3

          However, got another issue in another application using auto-increment.
           auto_increment_increment and auto_increment_offset reset to 1 in current session after alter table with auto-increment column. Reconnect DB will get back correct setting.

          Below see below example:

          MariaDB [testdb1]> show variables like 'auto_increment%' ;
          +--------------------------+-------+
          | Variable_name | Value |
          +--------------------------+-------+
          | auto_increment_increment | 3 |
          | auto_increment_offset | 2 |
          +--------------------------+-------+
          2 rows in set (0.001 sec)

          MariaDB [testdb1]>
          MariaDB [testdb1]>
          MariaDB [testdb1]> create table t4 (c1 int primary key auto_increment) ;
          Query OK, 0 rows affected (0.009 sec)

          MariaDB [testdb1]>
          MariaDB [testdb1]>
          MariaDB [testdb1]> show variables like 'auto_increment%' ;
          +--------------------------+-------+
          | Variable_name | Value |
          +--------------------------+-------+
          | auto_increment_increment | 3 |
          | auto_increment_offset | 2 |
          +--------------------------+-------+
          2 rows in set (0.001 sec)

          MariaDB [testdb1]>
          MariaDB [testdb1]>
          MariaDB [testdb1]> alter table t4 add (c2 varchar(50)) ;
          Query OK, 0 rows affected (0.006 sec)
          Records: 0 Duplicates: 0 Warnings: 0

          MariaDB [testdb1]>
          MariaDB [testdb1]>
          MariaDB [testdb1]> show variables like 'auto_increment%' ;
          +--------------------------+-------+
          | Variable_name | Value |
          +--------------------------+-------+
          | auto_increment_increment | 1 |
          | auto_increment_offset | 1 |
          +--------------------------+-------+
          2 rows in set (0.001 sec)

          MariaDB [testdb1]>
          MariaDB [testdb1]>
          MariaDB [testdb1]>










          Hi,

          We encounter sequence object issue as MDEV-27120. Then, trying to set
          {noformat}
          wsrep_auto_increment_control=OFF
          auto_increment_increment=3
          auto_increment_offset=1|2|3
          {noformat}
          However, got another issue in another application using auto-increment.
           auto_increment_increment and auto_increment_offset reset to 1 in current session after alter table with auto-increment column. Reconnect DB will get back correct setting.

          Below see below example:
          {noformat}
          MariaDB [testdb1]> show variables like 'auto_increment%' ;
          +--------------------------+-------+
          | Variable_name | Value |
          +--------------------------+-------+
          | auto_increment_increment | 3 |
          | auto_increment_offset | 2 |
          +--------------------------+-------+
          2 rows in set (0.001 sec)

          MariaDB [testdb1]>
          MariaDB [testdb1]>
          MariaDB [testdb1]> create table t4 (c1 int primary key auto_increment) ;
          Query OK, 0 rows affected (0.009 sec)

          MariaDB [testdb1]>
          MariaDB [testdb1]>
          MariaDB [testdb1]> show variables like 'auto_increment%' ;
          +--------------------------+-------+
          | Variable_name | Value |
          +--------------------------+-------+
          | auto_increment_increment | 3 |
          | auto_increment_offset | 2 |
          +--------------------------+-------+
          2 rows in set (0.001 sec)

          MariaDB [testdb1]>
          MariaDB [testdb1]>
          MariaDB [testdb1]> alter table t4 add (c2 varchar(50)) ;
          Query OK, 0 rows affected (0.006 sec)
          Records: 0 Duplicates: 0 Warnings: 0

          MariaDB [testdb1]>
          MariaDB [testdb1]>
          MariaDB [testdb1]> show variables like 'auto_increment%' ;
          +--------------------------+-------+
          | Variable_name | Value |
          +--------------------------+-------+
          | auto_increment_increment | 1 |
          | auto_increment_offset | 1 |
          +--------------------------+-------+
          2 rows in set (0.001 sec)

          MariaDB [testdb1]>
          MariaDB [testdb1]>
          MariaDB [testdb1]>
          {noformat}
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 127991 ] MariaDB v4 [ 143387 ]
          jplindst Jan Lindström (Inactive) made changes -
          Assignee Jan Lindström [ jplindst ]
          jplindst Jan Lindström (Inactive) made changes -
          Fix Version/s 10.4 [ 22408 ]
          jplindst Jan Lindström (Inactive) made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          jplindst Jan Lindström (Inactive) made changes -
          issue.field.resolutiondate 2022-10-10 04:35:49.0 2022-10-10 04:35:49.019
          jplindst Jan Lindström (Inactive) made changes -
          Fix Version/s 10.4.27 [ 28405 ]
          Fix Version/s 10.5.18 [ 28421 ]
          Fix Version/s 10.6.11 [ 28441 ]
          Fix Version/s 10.7.7 [ 28442 ]
          Fix Version/s 10.8.6 [ 28443 ]
          Fix Version/s 10.9.4 [ 28444 ]
          Fix Version/s 10.10.2 [ 28410 ]
          Fix Version/s 10.4 [ 22408 ]
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]

          People

            jplindst Jan Lindström (Inactive)
            frelist William Wong
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.