[MDEV-27123] 2. auto_increment_increment and auto_increment_offset reset to 1 in current session after alter table on auto-increment column Created: 2021-11-25  Updated: 2022-10-10  Resolved: 2022-10-10

Status: Closed
Project: MariaDB Server
Component/s: Galera
Affects Version/s: 10.5.12
Fix Version/s: 10.4.27, 10.5.18, 10.6.11, 10.7.7, 10.8.6, 10.9.4, 10.10.2

Type: Bug Priority: Major
Reporter: William Wong Assignee: Jan Lindström (Inactive)
Resolution: Fixed Votes: 0
Labels: galera
Environment:

redhat on vmware



 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]>


Generated at Thu Feb 08 09:50:30 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.