Skip to content

Commit

Permalink
skipping tests (#2464)
Browse files Browse the repository at this point in the history
Co-authored-by: James Cor <[email protected]>
  • Loading branch information
jycor and James Cor authored Apr 17, 2024
1 parent 7ab9e78 commit 960e3d9
Showing 1 changed file with 104 additions and 103 deletions.
207 changes: 104 additions & 103 deletions enginetest/queries/insert_queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -1279,109 +1279,6 @@ var InsertScripts = []ScriptTest{
},
},
},
{
Name: "auto increment does not increment on error",
SetUpScript: []string{
"create table auto1 (pk int primary key auto_increment);",
"insert into auto1 values (null);",
"create table auto2 (pk int primary key auto_increment, c int not null);",
"insert into auto2 values (null, 1);",
},
Assertions: []ScriptTestAssertion{
{
Query: "show create table auto1;",
Expected: []sql.Row{
{"auto1", "CREATE TABLE `auto1` (\n" +
" `pk` int NOT NULL AUTO_INCREMENT,\n" +
" PRIMARY KEY (`pk`)\n" +
") ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"},
},
},
{
Query: "insert into auto1 values (1);",
ExpectedErr: sql.ErrPrimaryKeyViolation,
},
{
Query: "show create table auto1;",
Expected: []sql.Row{
{"auto1", "CREATE TABLE `auto1` (\n" +
" `pk` int NOT NULL AUTO_INCREMENT,\n" +
" PRIMARY KEY (`pk`)\n" +
") ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"},
},
},
{
Query: "insert into auto1 values (null);",
Expected: []sql.Row{
{types.OkResult{RowsAffected: 1, InsertID: 2}},
},
},
{
Query: "show create table auto1;",
Expected: []sql.Row{
{"auto1", "CREATE TABLE `auto1` (\n" +
" `pk` int NOT NULL AUTO_INCREMENT,\n" +
" PRIMARY KEY (`pk`)\n" +
") ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"},
},
},
{
Query: "select * from auto1;",
Expected: []sql.Row{
{1},
{2},
},
},

{
Query: "show create table auto2;",
Expected: []sql.Row{
{"auto2", "CREATE TABLE `auto2` (\n" +
" `pk` int NOT NULL AUTO_INCREMENT,\n" +
" `c` int NOT NULL,\n" +
" PRIMARY KEY (`pk`)\n" +
") ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"},
},
},
{
Query: "insert into auto2 values (null, null);",
ExpectedErr: sql.ErrInsertIntoNonNullableProvidedNull,
},
{
Query: "show create table auto2;",
Expected: []sql.Row{
{"auto2", "CREATE TABLE `auto2` (\n" +
" `pk` int NOT NULL AUTO_INCREMENT,\n" +
" `c` int NOT NULL,\n" +
" PRIMARY KEY (`pk`)\n" +
") ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"},
},
},
{
Query: "insert into auto2 values (null, 2);",
Expected: []sql.Row{
{types.OkResult{RowsAffected: 1, InsertID: 2}},
},
},
{
Query: "show create table auto2;",
Expected: []sql.Row{
{"auto2", "CREATE TABLE `auto2` (\n" +
" `pk` int NOT NULL AUTO_INCREMENT,\n" +
" `c` int NOT NULL,\n" +
" PRIMARY KEY (`pk`)\n" +
") ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"},
},
},
{
Query: "select * from auto2;",
Expected: []sql.Row{
{1, 1},
{2, 2},
},
},
},
},
{
Name: "sql_mode=NO_AUTO_VALUE_ON_ZERO",
SetUpScript: []string{
Expand Down Expand Up @@ -2923,4 +2820,108 @@ var InsertBrokenScripts = []ScriptTest{
},
},
},
{
// https://github.com/dolthub/dolt/issues/3157
Name: "auto increment does not increment on error",
SetUpScript: []string{
"create table auto1 (pk int primary key auto_increment);",
"insert into auto1 values (null);",
"create table auto2 (pk int primary key auto_increment, c int not null);",
"insert into auto2 values (null, 1);",
},
Assertions: []ScriptTestAssertion{
{
Query: "show create table auto1;",
Expected: []sql.Row{
{"auto1", "CREATE TABLE `auto1` (\n" +
" `pk` int NOT NULL AUTO_INCREMENT,\n" +
" PRIMARY KEY (`pk`)\n" +
") ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"},
},
},
{
Query: "insert into auto1 values (1);",
ExpectedErr: sql.ErrPrimaryKeyViolation,
},
{
Query: "show create table auto1;",
Expected: []sql.Row{
{"auto1", "CREATE TABLE `auto1` (\n" +
" `pk` int NOT NULL AUTO_INCREMENT,\n" +
" PRIMARY KEY (`pk`)\n" +
") ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"},
},
},
{
Query: "insert into auto1 values (null);",
Expected: []sql.Row{
{types.OkResult{RowsAffected: 1, InsertID: 2}},
},
},
{
Query: "show create table auto1;",
Expected: []sql.Row{
{"auto1", "CREATE TABLE `auto1` (\n" +
" `pk` int NOT NULL AUTO_INCREMENT,\n" +
" PRIMARY KEY (`pk`)\n" +
") ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"},
},
},
{
Query: "select * from auto1;",
Expected: []sql.Row{
{1},
{2},
},
},

{
Query: "show create table auto2;",
Expected: []sql.Row{
{"auto2", "CREATE TABLE `auto2` (\n" +
" `pk` int NOT NULL AUTO_INCREMENT,\n" +
" `c` int NOT NULL,\n" +
" PRIMARY KEY (`pk`)\n" +
") ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"},
},
},
{
Query: "insert into auto2 values (null, null);",
ExpectedErr: sql.ErrInsertIntoNonNullableProvidedNull,
},
{
Query: "show create table auto2;",
Expected: []sql.Row{
{"auto2", "CREATE TABLE `auto2` (\n" +
" `pk` int NOT NULL AUTO_INCREMENT,\n" +
" `c` int NOT NULL,\n" +
" PRIMARY KEY (`pk`)\n" +
") ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"},
},
},
{
Query: "insert into auto2 values (null, 2);",
Expected: []sql.Row{
{types.OkResult{RowsAffected: 1, InsertID: 2}},
},
},
{
Query: "show create table auto2;",
Expected: []sql.Row{
{"auto2", "CREATE TABLE `auto2` (\n" +
" `pk` int NOT NULL AUTO_INCREMENT,\n" +
" `c` int NOT NULL,\n" +
" PRIMARY KEY (`pk`)\n" +
") ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_bin"},
},
},
{
Query: "select * from auto2;",
Expected: []sql.Row{
{1, 1},
{2, 2},
},
},
},
},
}

0 comments on commit 960e3d9

Please sign in to comment.