Skip to content

Commit

Permalink
Adding a test case for #6393
Browse files Browse the repository at this point in the history
  • Loading branch information
fulghum committed Jul 26, 2023
1 parent 988e71a commit 39e86c2
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions go/libraries/doltcore/sqle/enginetest/dolt_queries_merge.go
Original file line number Diff line number Diff line change
Expand Up @@ -4116,6 +4116,46 @@ var DoltVerifyConstraintsTestScripts = []queries.ScriptTest{
}

var ThreeWayMergeWithSchemaChangeTestScripts = []MergeScriptTest{
{
// Repro for https://github.com/dolthub/dolt/issues/6393
Name: "https://github.com/dolthub/dolt/issues/6393",
AncSetUpScript: []string{
"set autocommit = 0;",
"CREATE table parent (id int primary key);",
"CREATE table t (pk int primary key, col1 int, col2 varchar(100), col3 varchar(100), " +
" UNIQUE KEY unique1 (col2, pk));",
"ALTER TABLE t add CONSTRAINT fk1 FOREIGN KEY (col1) REFERENCES parent(id);",
"INSERT into parent VALUES (1), (2);",
"INSERT into t values (1, 1, '100', '11'), (2, 2, '200', '22');",
"alter table t add index idx1 (col3, col2);",
},
RightSetUpScript: []string{
"alter table t drop constraint fk1;",
"alter table t drop column col1;",
},
LeftSetUpScript: []string{
"insert into t values (3, 1, 'one', 'two');",
},
Assertions: []queries.ScriptTestAssertion{
{
Query: "call dolt_merge('right');",
Expected: []sql.Row{{doltCommit, 0, 0}},
},
{
Query: "select * from dolt_conflicts;",
Expected: []sql.Row{},
},
{
Query: "select * from t;",
Expected: []sql.Row{
{1, "100", "11"},
{2, "200", "22"},
{3, "one", "two"},
},
},
},
},

// Data conflicts during a merge with schema changes
{
Name: "data conflict",
Expand Down

0 comments on commit 39e86c2

Please sign in to comment.