[MDEV-30773] mysqldump --no-data does not show auto increment counter for unused tables Created: 2023-03-02  Updated: 2023-03-30

Status: Open
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 10.3.37
Fix Version/s: None

Type: Bug Priority: Trivial
Reporter: Michaël de groot Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Hi,

I assume that this is for other versions as well, but I experienced this on 10.3.37.

When running mysqldump --no-data to dump the schema, some tables do not show their auto increment value. I initially thought this was due to the table not being opened, but it is not. I tried to login to the same instances and execute SHOW CREATE TABLE, but afterwards the dump still did not show the value.

I don't know the cause or how to reproduce, but adding this issue anyways as it might be useful later on.

Thank you,
Michael



 Comments   
Comment by Anel Husakovic [ 2023-03-02 ]

Hi,
just to clarify, you saw situation where some tables show and some tables don't show auto increment value?
Can you paste the result of the show create table for each case?

Comment by Daniel Black [ 2023-03-02 ]

Why is it important that SHOW CREATE TABLE does show the last auto_increment value?

Yes, its in 10.3 too and probably has been the case since the beginning of auto_increment.

MariaDB [test]> create table t2 (i int primary key auto_increment);
Query OK, 0 rows affected (0.001 sec)
 
MariaDB [test]> show create table t2\G
*************************** 1. row ***************************
       Table: t2
Create Table: CREATE TABLE `t2` (
  `i` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`i`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
1 row in set (0.001 sec)
 
MariaDB [test]> insert into t2()  values ();
Query OK, 1 row affected (0.001 sec)
 
MariaDB [test]> show create table t2\G
*************************** 1. row ***************************
       Table: t2
Create Table: CREATE TABLE `t2` (
  `i` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`i`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
1 row in set (0.000 sec)

Generated at Thu Feb 08 10:18:47 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.