Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AUTO_INCREMENT behaviour different between MySQL and TiDB #38726

Closed
tiancaiamao opened this issue Oct 28, 2022 · 2 comments
Closed

AUTO_INCREMENT behaviour different between MySQL and TiDB #38726

tiancaiamao opened this issue Oct 28, 2022 · 2 comments
Labels
type/bug The issue is confirmed as a bug. wontfix This issue will not be fixed.

Comments

@tiancaiamao
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

set @@auto_increment_increment = 5;
set @@auto_increment_offset = 10;
create table io (a int key auto_increment);
insert into io values (null),(null),(null);

2. What did you expect to see? (Required)

mysql> select * from io;
+----+
| a  |
+----+
|  4 |
|  9 |
| 10 |
+----+
3 rows in set (0.00 sec)

3. What did you see instead (Required)

mysql> select * from io;
+----+
| a  |
+----+
| 10 |
| 15 |
| 20 |
+----+
3 rows in set (0.00 sec)

4. What is your TiDB version? (Required)

master b9029f1

@tiancaiamao tiancaiamao added type/bug The issue is confirmed as a bug. wontfix This issue will not be fixed. labels Oct 28, 2022
@tiancaiamao
Copy link
Contributor Author

Ref #38442

@tiancaiamao
Copy link
Contributor Author

// This issue is a flaw of the implementation of MySQL and it doesn't exist in TiDB.

It's a flaw of the implementation of MySQL, so TiDB doesn't follow this behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The issue is confirmed as a bug. wontfix This issue will not be fixed.
Projects
None yet
Development

No branches or pull requests

1 participant