Skip to content

Commit 57cbe40

Browse files
authored
[no-release-notes] test views with dolt procedures (#8532)
1 parent 948c261 commit 57cbe40

File tree

3 files changed

+41
-3
lines changed

3 files changed

+41
-3
lines changed

go/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ require (
5757
github.com/cespare/xxhash/v2 v2.2.0
5858
github.com/creasty/defaults v1.6.0
5959
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2
60-
github.com/dolthub/go-mysql-server v0.18.2-0.20241105220811-e48937b9c7a2
60+
github.com/dolthub/go-mysql-server v0.18.2-0.20241106010546-3281d09c1f15
6161
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63
6262
github.com/dolthub/swiss v0.1.0
6363
github.com/goccy/go-json v0.10.2

go/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ github.com/dolthub/fslock v0.0.3 h1:iLMpUIvJKMKm92+N1fmHVdxJP5NdyDK5bK7z7Ba2s2U=
183183
github.com/dolthub/fslock v0.0.3/go.mod h1:QWql+P17oAAMLnL4HGB5tiovtDuAjdDTPbuqx7bYfa0=
184184
github.com/dolthub/go-icu-regex v0.0.0-20240916130659-0118adc6b662 h1:aC17hZD6iwzBwwfO5M+3oBT5E5gGRiQPdn+vzpDXqIA=
185185
github.com/dolthub/go-icu-regex v0.0.0-20240916130659-0118adc6b662/go.mod h1:KPUcpx070QOfJK1gNe0zx4pA5sicIK1GMikIGLKC168=
186-
github.com/dolthub/go-mysql-server v0.18.2-0.20241105220811-e48937b9c7a2 h1:m/LVJjR7wpS3i2QroURpNoQkSu4GaUyjSwiVW09dcf0=
187-
github.com/dolthub/go-mysql-server v0.18.2-0.20241105220811-e48937b9c7a2/go.mod h1:0xWs/FBE4xlhlOsAWoGh24SDRHemT7/U1nApu7SNRXg=
186+
github.com/dolthub/go-mysql-server v0.18.2-0.20241106010546-3281d09c1f15 h1:VGjaqZKfys8GeaI5uIaKr9y4XZbqMWlA5DJcgfiMHl8=
187+
github.com/dolthub/go-mysql-server v0.18.2-0.20241106010546-3281d09c1f15/go.mod h1:0xWs/FBE4xlhlOsAWoGh24SDRHemT7/U1nApu7SNRXg=
188188
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63 h1:OAsXLAPL4du6tfbBgK0xXHZkOlos63RdKYS3Sgw/dfI=
189189
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63/go.mod h1:lV7lUeuDhH5thVGDCKXbatwKy2KW80L4rMT46n+Y2/Q=
190190
github.com/dolthub/ishell v0.0.0-20240701202509-2b217167d718 h1:lT7hE5k+0nkBdj/1UOSFwjWpNxf+LCApbRHgnCA17XE=

go/libraries/doltcore/sqle/enginetest/dolt_queries_diff.go

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,6 +1453,44 @@ on a.to_pk = b.to_pk;`,
14531453
},
14541454
},
14551455
},
1456+
{
1457+
Name: "diff table function works with views",
1458+
SetUpScript: []string{
1459+
"create table t (i int primary key);",
1460+
"call dolt_commit('-Am', 'created table')",
1461+
"insert into t values (1), (2), (3);",
1462+
"call dolt_commit('-Am', 'inserted into table')",
1463+
"create view v as select to_i, to_commit, from_i, from_commit, diff_type from dolt_diff('HEAD', 'HEAD~1', 't');",
1464+
},
1465+
Assertions: []queries.ScriptTestAssertion{
1466+
{
1467+
Query: "select * from v;",
1468+
Expected: []sql.Row{
1469+
{nil, "HEAD~1", 1, "HEAD", "removed"},
1470+
{nil, "HEAD~1", 2, "HEAD", "removed"},
1471+
{nil, "HEAD~1", 3, "HEAD", "removed"},
1472+
},
1473+
},
1474+
{
1475+
Query: "insert into t values (4), (5), (6);",
1476+
Expected: []sql.Row{
1477+
{gmstypes.NewOkResult(3)},
1478+
},
1479+
},
1480+
{
1481+
Query: "call dolt_commit('-Am', 'inserted into table again');",
1482+
SkipResultsCheck: true,
1483+
},
1484+
{
1485+
Query: "select * from v;",
1486+
Expected: []sql.Row{
1487+
{nil, "HEAD~1", 4, "HEAD", "removed"},
1488+
{nil, "HEAD~1", 5, "HEAD", "removed"},
1489+
{nil, "HEAD~1", 6, "HEAD", "removed"},
1490+
},
1491+
},
1492+
},
1493+
},
14561494
}
14571495

14581496
var DiffStatTableFunctionScriptTests = []queries.ScriptTest{

0 commit comments

Comments
 (0)