-
-
Couldn't load subscription status.
- Fork 585
Open
dolthub/go-mysql-server
#2461Labels
bugSomething isn't workingSomething isn't workingcorrectnessWe don't return the same result as MySQLWe don't return the same result as MySQLsqlIssue with SQLIssue with SQL
Description
When an insertion fails, a column defined with auto_increment still increments the value.
Repro:
test_db> create table t (i int primary key auto_increment, j int not null);
test_db> insert into t values (0,0);
Query OK, 1 row affected
test_db> select * from t;
+---+---+
| i | j |
+---+---+
| 1 | 0 |
+---+---+
test_db> insert into t values (0, null);
column name 'j' is non-nullable but attempted to set a value of null
test_db> select * from t;
+---+---+
| i | j |
+---+---+
| 1 | 0 |
+---+---+
test_db> insert into t values (0, 0);
Query OK, 1 row affected
test_db> select * from t;
+---+---+
| i | j |
+---+---+
| 1 | 0 |
| 3 | 0 |
+---+---+The resulting table should be:
mysql> select * from t;
+---+---+
| i | j |
+---+---+
| 1 | 0 |
| 2 | 0 |
+---+---+Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcorrectnessWe don't return the same result as MySQLWe don't return the same result as MySQLsqlIssue with SQLIssue with SQL