【发布时间】:2021-05-13 16:33:39
【问题描述】:
我正在尝试迁移到 Aurora MySQL,但遇到自动增量问题。使用 Aurora MySQL:
create table test (id int NOT NULL AUTO_INCREMENT,Primary Key(id));
insert into test (id) values(0);
insert into test (id) values(0);
insert into test (id) values(0);
update test set id=100 where id=3;
select * from test;
+-----+
| id |
+-----+
| 1 |
| 2 |
| 100 |
+-----+
insert into test (id) values(0);
select * from test;
+-----+
| id |
+-----+
| 1 |
| 2 |
| 4 |
| 100 |
+-----+
With MySQL or MariaDb the last result is:
+-----+
| id |
+-----+
| 1 |
| 2 |
| 100 |
| 101 |
+-----+
请注意,Aurora MySQL “填补”了 MySQL 保持并使用最大值的空白。
我能否将 Aurora MySQL 配置为保持相同的自动增量行为?如果有,怎么做?
【问题讨论】:
-
Mariadb 版本是 5.5.65-MariaDB。 Aurora MySQL 是 5.7.mysql_aurora.2.07.2
标签: mysql amazon-web-services auto-increment amazon-aurora