You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: go/libraries/doltcore/sqle/enginetest/dolt_queries_diff.go
+21-4Lines changed: 21 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -5428,25 +5428,36 @@ var CommitDiffSystemTableScriptTests = []queries.ScriptTest{
5428
5428
},
5429
5429
},
5430
5430
{
5431
-
Name: "workingand staged commits",
5431
+
Name: "working, staged, and head commits",
5432
5432
SetUpScript: []string{
5433
5433
"create table t (pk int primary key, c1 int, c2 int);",
5434
5434
"call dolt_commit('-Am', 'created table');",
5435
-
"set @Commit0 = HASHOF('HEAD');",
5435
+
"call dolt_branch('Commit0');",
5436
+
"insert into t values (7, 8, 9);",
5437
+
"call dolt_commit('-Am', 'insert into table');",
5438
+
"call dolt_branch('Commit1')",
5436
5439
"insert into t values (1, 2, 3);",
5437
5440
"call dolt_add('.');",
5438
5441
"insert into t values (4, 5, 6);",
5439
5442
},
5440
5443
Assertions: []queries.ScriptTestAssertion{
5441
5444
{
5442
-
Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT='WORKING' and FROM_COMMIT=@Commit0;",
5445
+
Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT='WORKING' and FROM_COMMIT='HEAD';",
5446
+
Expected: []sql.Row{
5447
+
{1, 2, 3, nil, nil, nil, "added"},
5448
+
{4, 5, 6, nil, nil, nil, "added"},
5449
+
},
5450
+
},
5451
+
{
5452
+
Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT='WORKING' and FROM_COMMIT='HEAD~';",
5443
5453
Expected: []sql.Row{
5444
5454
{1, 2, 3, nil, nil, nil, "added"},
5445
5455
{4, 5, 6, nil, nil, nil, "added"},
5456
+
{7, 8, 9, nil, nil, nil, "added"},
5446
5457
},
5447
5458
},
5448
5459
{
5449
-
Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT='STAGED' and FROM_COMMIT=@Commit0;",
5460
+
Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_COMMIT_DIFF_t WHERE TO_COMMIT='STAGED' and FROM_COMMIT='HEAD';",
5450
5461
Expected: []sql.Row{
5451
5462
{1, 2, 3, nil, nil, nil, "added"},
5452
5463
},
@@ -5463,6 +5474,12 @@ var CommitDiffSystemTableScriptTests = []queries.ScriptTest{
5463
5474
{nil, nil, nil, 4, 5, 6, "removed"},
5464
5475
},
5465
5476
},
5477
+
{
5478
+
Query: "SELECT to_pk, to_c1, to_c2, from_pk, from_c1, from_c2, diff_type FROM DOLT_COMMIT_DIFF_t AS OF Commit1 WHERE TO_COMMIT='HEAD' and FROM_COMMIT='Commit0';",
0 commit comments