unskipped autoincrement bats for __DOLT_1__, created mirrored enginetest

This commit is contained in:
Andy Arthur
2022-07-18 11:59:04 -07:00
parent 1a888b42c7
commit 28560ea0e7
2 changed files with 68 additions and 4 deletions

View File

@@ -1657,6 +1657,74 @@ var MergeScripts = []queries.ScriptTest{
//},
},
},
{
Name: "dolt_merge() works with no auto increment overlap",
SetUpScript: []string{
"CREATE TABLE t (pk int PRIMARY KEY AUTO_INCREMENT, c0 int);",
"INSERT INTO t (c0) VALUES (1), (2);",
"CALL dolt_commit('-a', '-m', 'cm1');",
"CALL dolt_checkout('-b', 'test');",
"INSERT INTO t (c0) VALUES (3), (4);",
"CALL dolt_commit('-a', '-m', 'cm2');",
"CALL dolt_checkout('main');",
},
Assertions: []queries.ScriptTestAssertion{
{
Query: "CALL dolt_merge('test');",
Expected: []sql.Row{{1, 0}},
},
{
Query: "INSERT INTO t VALUES (NULL,5),(6,6),(NULL,7);",
Expected: []sql.Row{{sql.OkResult{RowsAffected: 3, InsertID: 5}}},
},
{
Query: "SELECT * FROM t ORDER BY pk;",
Expected: []sql.Row{
{1, 1},
{2, 2},
{3, 3},
{4, 4},
{5, 5},
{6, 6},
{7, 7},
},
},
},
},
{
Name: "dolt_merge() with a gap in an auto increment key",
SetUpScript: []string{
"CREATE TABLE t (pk int PRIMARY KEY AUTO_INCREMENT, c0 int);",
"INSERT INTO t (c0) VALUES (1), (2);",
"CALL dolt_add('-A');",
"CALL dolt_commit('-am', 'cm1');",
"CALL dolt_checkout('-b', 'test');",
"INSERT INTO t VALUES (4,4), (5,5);",
"CALL dolt_commit('-am', 'cm2');",
"CALL dolt_checkout('main');",
},
Assertions: []queries.ScriptTestAssertion{
{
Query: "CALL dolt_merge('test');",
Expected: []sql.Row{{1, 0}},
},
{
Query: "INSERT INTO t VALUES (3,3),(NULL,6);",
Expected: []sql.Row{{sql.OkResult{RowsAffected: 2, InsertID: 3}}},
},
{
Query: "SELECT * FROM t ORDER BY pk;",
Expected: []sql.Row{
{1, 1},
{2, 2},
{3, 3},
{4, 4},
{5, 5},
{6, 6},
},
},
},
},
}
var KeylessMergeCVsAndConflictsScripts = []queries.ScriptTest{

View File

@@ -434,8 +434,6 @@ SQL
}
@test "auto_increment: dolt_merge() works with no auto increment overlap" {
skip_nbf_dolt_1
dolt sql <<SQL
CREATE TABLE t (
pk int PRIMARY KEY AUTO_INCREMENT,
@@ -500,8 +498,6 @@ SQL
}
@test "auto_increment: dolt_merge() with a gap in an auto increment key" {
skip_nbf_dolt_1
dolt sql <<SQL
CREATE TABLE t (
pk int PRIMARY KEY AUTO_INCREMENT,