Skip to content

Commit 6842f4a

Browse files
authored
Merge pull request #901 from dolthub/taylor/read-dtables
More system table updates, add and unskip some tests
2 parents efb36fa + e6d6a19 commit 6842f4a

File tree

6 files changed

+1061
-43
lines changed

6 files changed

+1061
-43
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ require (
88
github.com/PuerkitoBio/goquery v1.8.1
99
github.com/cockroachdb/apd/v2 v2.0.3-0.20200518165714-d020e156310a
1010
github.com/cockroachdb/errors v1.7.5
11-
github.com/dolthub/dolt/go v0.40.5-0.20241028195925-746ebc613846
11+
github.com/dolthub/dolt/go v0.40.5-0.20241030222313-1035f4fe0f65
1212
github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20240827111219-e4bb9ca3442d
1313
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2
1414
github.com/dolthub/go-icu-regex v0.0.0-20240916130659-0118adc6b662
15-
github.com/dolthub/go-mysql-server v0.18.2-0.20241028220705-fc9e96ed4c1d
15+
github.com/dolthub/go-mysql-server v0.18.2-0.20241029221022-84d576aadba3
1616
github.com/dolthub/sqllogictest/go v0.0.0-20240618184124-ca47f9354216
1717
github.com/dolthub/vitess v0.0.0-20241028204000-267861bc75a0
1818
github.com/fatih/color v1.13.0

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm
214214
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
215215
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
216216
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
217-
github.com/dolthub/dolt/go v0.40.5-0.20241028195925-746ebc613846 h1:IYbgv29ClfGVj/vM4qxQpZJQnw9XdrW8UZxNaVYJjKc=
218-
github.com/dolthub/dolt/go v0.40.5-0.20241028195925-746ebc613846/go.mod h1:sZ612KergPWZQkkCL5uVi6BV15YH08HlBXOyRzEccg8=
217+
github.com/dolthub/dolt/go v0.40.5-0.20241030222313-1035f4fe0f65 h1:M+mytO/63y6/1/izuKKn6WQ+bvHSARHOq+3m4nHYEsw=
218+
github.com/dolthub/dolt/go v0.40.5-0.20241030222313-1035f4fe0f65/go.mod h1:i8wcX6lhfFfRt5SR9YzL6l4rHMguTOaz+uvQBTjoykE=
219219
github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20240827111219-e4bb9ca3442d h1:RZkQeYOrDrOWzCxaP2ttkvg4E2TM9n8lnEsIBLKjqkM=
220220
github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20240827111219-e4bb9ca3442d/go.mod h1:L5RDYZbC9BBWmoU2+TjTekeqqhFXX5EqH9ln00O0stY=
221221
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 h1:u3PMzfF8RkKd3lB9pZ2bfn0qEG+1Gms9599cr0REMww=
@@ -224,8 +224,8 @@ github.com/dolthub/fslock v0.0.3 h1:iLMpUIvJKMKm92+N1fmHVdxJP5NdyDK5bK7z7Ba2s2U=
224224
github.com/dolthub/fslock v0.0.3/go.mod h1:QWql+P17oAAMLnL4HGB5tiovtDuAjdDTPbuqx7bYfa0=
225225
github.com/dolthub/go-icu-regex v0.0.0-20240916130659-0118adc6b662 h1:aC17hZD6iwzBwwfO5M+3oBT5E5gGRiQPdn+vzpDXqIA=
226226
github.com/dolthub/go-icu-regex v0.0.0-20240916130659-0118adc6b662/go.mod h1:KPUcpx070QOfJK1gNe0zx4pA5sicIK1GMikIGLKC168=
227-
github.com/dolthub/go-mysql-server v0.18.2-0.20241028220705-fc9e96ed4c1d h1:FLs7/W5OmRnp/UPRw5PEa+PrcvtVk5ZV+C9RCQ78CnE=
228-
github.com/dolthub/go-mysql-server v0.18.2-0.20241028220705-fc9e96ed4c1d/go.mod h1:jlzVUA+tsjDw6YKbhRsCLHT3OVO6nn4BWrUanECTo3s=
227+
github.com/dolthub/go-mysql-server v0.18.2-0.20241029221022-84d576aadba3 h1:+8/lCQN28l+a14+b/RX3DfkWU5eZMKTqIt8ATKWEQ7c=
228+
github.com/dolthub/go-mysql-server v0.18.2-0.20241029221022-84d576aadba3/go.mod h1:jlzVUA+tsjDw6YKbhRsCLHT3OVO6nn4BWrUanECTo3s=
229229
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63 h1:OAsXLAPL4du6tfbBgK0xXHZkOlos63RdKYS3Sgw/dfI=
230230
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63/go.mod h1:lV7lUeuDhH5thVGDCKXbatwKy2KW80L4rMT46n+Y2/Q=
231231
github.com/dolthub/ishell v0.0.0-20240701202509-2b217167d718 h1:lT7hE5k+0nkBdj/1UOSFwjWpNxf+LCApbRHgnCA17XE=

server/tables/dtables/init.go

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,92 @@ import (
2121

2222
// Init handles initialization of all Postgres-specific and Doltgres-specific Dolt system tables.
2323
func Init() {
24-
dtables.GetDocsSchema = getDocsSchema
25-
doltdb.GetDocTableName = getDocTableName
24+
// Table names
2625
doltdb.GetBranchesTableName = getBranchesTableName
26+
doltdb.GetDocTableName = getDocTableName
27+
doltdb.GetColumnDiffTableName = getColumnDiffTableName
28+
doltdb.GetCommitAncestorsTableName = getCommitAncestorsTableName
29+
doltdb.GetCommitsTableName = getCommitsTableName
30+
doltdb.GetDiffTableName = getDiffTableName
2731
doltdb.GetLogTableName = getLogTableName
32+
doltdb.GetMergeStatusTableName = getMergeStatusTableName
33+
doltdb.GetRemoteBranchesTableName = getRemoteBranchesTableName
34+
doltdb.GetRemotesTableName = getRemotesTableName
35+
doltdb.GetSchemaConflictsTableName = getSchemaConflictsTableName
2836
doltdb.GetStatusTableName = getStatusTableName
37+
doltdb.GetTableOfTablesInConflictName = getTableOfTablesInConflictName
38+
doltdb.GetTableOfTablesWithViolationsName = getTableOfTablesWithViolationsName
2939
doltdb.GetTagsTableName = getTagsTableName
40+
41+
// Schemas
42+
dtables.GetDocsSchema = getDocsSchema
3043
}
3144

3245
// getBranchesTableName returns the name of the branches table.
3346
func getBranchesTableName() string {
3447
return "branches"
3548
}
3649

50+
// getColumnDiffTableName returns the name of the column diff table.
51+
func getColumnDiffTableName() string {
52+
return "column_diff"
53+
}
54+
55+
// getCommitAncestorsTableName returns the name of the commit ancestors table.
56+
func getCommitAncestorsTableName() string {
57+
return "commit_ancestors"
58+
}
59+
60+
// getCommitsTableName returns the name of the commits table.
61+
func getCommitsTableName() string {
62+
return "commits"
63+
}
64+
65+
// getDiffTableName returns the name of the diff table.
66+
func getDiffTableName() string {
67+
return "diff"
68+
}
69+
3770
// getLogTableName returns the name of the branches table.
3871
func getLogTableName() string {
3972
return "log"
4073
}
4174

75+
// getMergeStatusTableName returns the name of the merge status table.
76+
func getMergeStatusTableName() string {
77+
return "merge_status"
78+
}
79+
80+
// getRemoteBranchesTableName returns the name of the remote branches table.
81+
func getRemoteBranchesTableName() string {
82+
return "remote_branches"
83+
}
84+
85+
// getRemotesTableName returns the name of the remotes table.
86+
func getRemotesTableName() string {
87+
return "remotes"
88+
}
89+
90+
// getSchemaConflictsTableName returns the name of the schema conflicts table.
91+
func getSchemaConflictsTableName() string {
92+
return "schema_conflicts"
93+
}
94+
4295
// getStatusTableName returns the name of the status table.
4396
func getStatusTableName() string {
4497
return "status"
4598
}
4699

100+
// getTableOfTablesInConflictName returns the name of the conflicts table.
101+
func getTableOfTablesInConflictName() string {
102+
return "conflicts"
103+
}
104+
105+
// getTableOfTablesWithViolationsName returns the name of the constraint violations table.
106+
func getTableOfTablesWithViolationsName() string {
107+
return "constraint_violations"
108+
}
109+
47110
// getTagsTableName returns the name of the tags table.
48111
func getTagsTableName() string {
49112
return "tags"

testing/go/dolt_functions_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ func TestDoltFunctions(t *testing.T) {
270270
},
271271
},
272272
{
273-
Name: "smoke test select dolt_diff functions and tables",
273+
Name: "smoke test select dolt diff functions and tables",
274274
SetUpScript: []string{
275275
"CREATE TABLE t1 (pk int primary key);",
276276
"INSERT INTO t1 VALUES (1);",
@@ -320,7 +320,7 @@ func TestDoltFunctions(t *testing.T) {
320320
},
321321
},
322322
{
323-
Query: "SELECT * FROM dolt_diff",
323+
Query: "SELECT * FROM dolt.diff",
324324
Expected: []sql.Row{
325325
{"WORKING", "public.t1", nil, nil, nil, nil, 1, 1},
326326
},
@@ -361,7 +361,7 @@ func TestDoltFunctions(t *testing.T) {
361361
},
362362
},
363363
{
364-
Name: "smoke test select dolt_diff functions and tables for multiple schemas",
364+
Name: "smoke test select dolt diff functions and tables for multiple schemas",
365365
SetUpScript: []string{
366366
"CREATE TABLE t1 (pk int primary key);",
367367
"INSERT INTO t1 VALUES (1);",
@@ -436,7 +436,7 @@ func TestDoltFunctions(t *testing.T) {
436436
},
437437
},
438438
{
439-
Query: "SELECT * FROM dolt_diff",
439+
Query: "SELECT * FROM dolt.diff",
440440
Expected: []sql.Row{
441441
{"WORKING", "public.t1", nil, nil, nil, nil, 1, 1},
442442
{"WORKING", "testschema.t2", nil, nil, nil, nil, 1, 1},

0 commit comments

Comments
 (0)