Skip to content

Commit d9d9a96

Browse files
authored
Merge pull request #2400 from dolthub/zachmu/ld1
[no-release-notes] removed some LD1 specific code
2 parents 2dc22f3 + 717b3c5 commit d9d9a96

4 files changed

Lines changed: 26 additions & 57 deletions

File tree

core/override_functions.go

Lines changed: 14 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import (
1919
"fmt"
2020
"strings"
2121

22-
"github.com/cockroachdb/errors"
2322
doltserial "github.com/dolthub/dolt/go/gen/fb/serial"
2423
"github.com/dolthub/dolt/go/libraries/doltcore/doltdb"
2524
"github.com/dolthub/dolt/go/store/hash"
@@ -34,53 +33,30 @@ import (
3433

3534
// emptyRootValue is Doltgres' implementation of doltdb.EmptyRootValue.
3635
func emptyRootValue(ctx context.Context, vrw types.ValueReadWriter, ns tree.NodeStore) (doltdb.RootValue, error) {
37-
if vrw.Format().UsesFlatbuffers() {
38-
builder := flatbuffers.NewBuilder(80)
36+
builder := flatbuffers.NewBuilder(80)
3937

40-
emptyam, err := prolly.NewEmptyAddressMap(ns)
41-
if err != nil {
42-
return nil, err
43-
}
44-
ambytes := []byte(tree.ValueFromNode(emptyam.Node()).(types.SerialMessage))
45-
tablesoff := builder.CreateByteVector(ambytes)
46-
47-
var empty hash.Hash
48-
fkoff := builder.CreateByteVector(empty[:])
49-
serial.RootValueStart(builder)
50-
serial.RootValueAddFeatureVersion(builder, int64(DoltgresFeatureVersion))
51-
serial.RootValueAddCollation(builder, serial.Collationutf8mb4_0900_bin)
52-
serial.RootValueAddTables(builder, tablesoff)
53-
serial.RootValueAddForeignKeyAddr(builder, fkoff)
54-
bs := doltserial.FinishMessage(builder, serial.RootValueEnd(builder), []byte(doltserial.DoltgresRootValueFileID))
55-
return newRootValue(ctx, vrw, ns, types.SerialMessage(bs))
56-
}
57-
58-
empty, err := types.NewMap(ctx, vrw)
59-
if err != nil {
60-
return nil, err
61-
}
62-
63-
sd := types.StructData{
64-
tablesKey: empty,
65-
foreignKeyKey: empty,
66-
featureVersKey: types.Int(DoltgresFeatureVersion),
67-
}
68-
69-
st, err := types.NewStruct(vrw.Format(), ddbRootStructName, sd)
38+
emptyam, err := prolly.NewEmptyAddressMap(ns)
7039
if err != nil {
7140
return nil, err
7241
}
73-
74-
return newRootValue(ctx, vrw, ns, st)
42+
ambytes := []byte(tree.ValueFromNode(emptyam.Node()).(types.SerialMessage))
43+
tablesoff := builder.CreateByteVector(ambytes)
44+
45+
var empty hash.Hash
46+
fkoff := builder.CreateByteVector(empty[:])
47+
serial.RootValueStart(builder)
48+
serial.RootValueAddFeatureVersion(builder, int64(DoltgresFeatureVersion))
49+
serial.RootValueAddCollation(builder, serial.Collationutf8mb4_0900_bin)
50+
serial.RootValueAddTables(builder, tablesoff)
51+
serial.RootValueAddForeignKeyAddr(builder, fkoff)
52+
bs := doltserial.FinishMessage(builder, serial.RootValueEnd(builder), []byte(doltserial.DoltgresRootValueFileID))
53+
return newRootValue(ctx, vrw, ns, types.SerialMessage(bs))
7554
}
7655

7756
// newRootValue is Doltgres' implementation of doltdb.NewRootValue.
7857
func newRootValue(ctx context.Context, vrw types.ValueReadWriter, ns tree.NodeStore, v types.Value) (doltdb.RootValue, error) {
7958
var st storage.RootStorage
8059

81-
if !vrw.Format().UsesFlatbuffers() {
82-
return nil, errors.Errorf("unsupported vrw")
83-
}
8460
srv, err := serial.TryGetRootAsRootValue([]byte(v.(types.SerialMessage)), doltserial.MessagePrefixSz)
8561
if err != nil {
8662
return nil, err

core/rootvalue.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@ import (
4040
"github.com/dolthub/doltgresql/core/triggers"
4141
)
4242

43-
const (
44-
ddbRootStructName = "dolt_db_root"
45-
tablesKey = "tables"
46-
foreignKeyKey = "foreign_key"
47-
featureVersKey = "feature_ver"
48-
)
49-
5043
// DoltgresFeatureVersion is Doltgres' feature version. We use Dolt's feature version added to our own.
5144
var DoltgresFeatureVersion = doltdb.DoltFeatureVersion + 0
5245

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ require (
66
github.com/PuerkitoBio/goquery v1.8.1
77
github.com/cockroachdb/apd/v2 v2.0.3-0.20200518165714-d020e156310a
88
github.com/cockroachdb/errors v1.7.5
9-
github.com/dolthub/dolt/go v0.40.5-0.20260221000349-62fb1a953720
9+
github.com/dolthub/dolt/go v0.40.5-0.20260227222610-de30a407407f
1010
github.com/dolthub/eventsapi_schema v0.0.0-20260205214132-a7a3c84c84a1
1111
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2
12-
github.com/dolthub/go-mysql-server v0.20.1-0.20260220232524-cd9aa3651dba
12+
github.com/dolthub/go-mysql-server v0.20.1-0.20260226225506-66cdd268afba
1313
github.com/dolthub/pg_query_go/v6 v6.0.0-20251215122834-fb20be4254d1
1414
github.com/dolthub/sqllogictest/go v0.0.0-20240618184124-ca47f9354216
15-
github.com/dolthub/vitess v0.0.0-20260202234501-b14ed9b1632b
15+
github.com/dolthub/vitess v0.0.0-20260225173707-20566e4abe9e
1616
github.com/fatih/color v1.13.0
1717
github.com/goccy/go-json v0.10.2
1818
github.com/gogo/protobuf v1.3.2
@@ -55,7 +55,7 @@ require (
5555
cloud.google.com/go/iam v1.5.2 // indirect
5656
cloud.google.com/go/monitoring v1.24.2 // indirect
5757
cloud.google.com/go/storage v1.50.0 // indirect
58-
filippo.io/edwards25519 v1.1.0 // indirect
58+
filippo.io/edwards25519 v1.1.1 // indirect
5959
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 // indirect
6060
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 // indirect
6161
github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 // indirect

go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ cloud.google.com/go/storage v1.50.0/go.mod h1:l7XeiD//vx5lfqE3RavfmU9yvk5Pp0Zhcv
4242
cloud.google.com/go/trace v1.11.6 h1:2O2zjPzqPYAHrn3OKl029qlqG6W8ZdYaOWRyr8NgMT4=
4343
cloud.google.com/go/trace v1.11.6/go.mod h1:GA855OeDEBiBMzcckLPE2kDunIpC72N+Pq8WFieFjnI=
4444
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
45-
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
46-
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
45+
filippo.io/edwards25519 v1.1.1 h1:YpjwWWlNmGIDyXOn8zLzqiD+9TyIlPhGFG96P39uBpw=
46+
filippo.io/edwards25519 v1.1.1/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
4747
git.sr.ht/~sbinet/gg v0.3.1 h1:LNhjNn8DerC8f9DHLz6lS0YYul/b602DUxDgGkd/Aik=
4848
git.sr.ht/~sbinet/gg v0.3.1/go.mod h1:KGYtlADtqsqANL9ueOFkWymvzUvLMQllU5Ixo+8v3pc=
4949
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
@@ -245,8 +245,8 @@ github.com/dolthub/aws-sdk-go-ini-parser v0.0.0-20250305001723-2821c37f6c12 h1:I
245245
github.com/dolthub/aws-sdk-go-ini-parser v0.0.0-20250305001723-2821c37f6c12/go.mod h1:rN7X8BHwkjPcfMQQ2QTAq/xM3leUSGLfb+1Js7Y6TVo=
246246
github.com/dolthub/dolt-mcp v0.3.4 h1:AyG5cw+fNWXDHXujtQnqUPZrpWtPg6FN6yYtjv1pP44=
247247
github.com/dolthub/dolt-mcp v0.3.4/go.mod h1:bCZ7KHvDYs+M0e+ySgmGiNvLhcwsN7bbf5YCyillLrk=
248-
github.com/dolthub/dolt/go v0.40.5-0.20260221000349-62fb1a953720 h1:OIYL1CRzzBXrSwLtTweNmCAVXaypEvd/wYcpLZ0XKFY=
249-
github.com/dolthub/dolt/go v0.40.5-0.20260221000349-62fb1a953720/go.mod h1:3yQ+BQaIPcjA/dsmvK7tbpY6yfQMWMHVZUUuEnQz1dE=
248+
github.com/dolthub/dolt/go v0.40.5-0.20260227222610-de30a407407f h1:6zARvWPU3yv+cEeoCQCbAz8hNf698nt14mkQDR+eX/4=
249+
github.com/dolthub/dolt/go v0.40.5-0.20260227222610-de30a407407f/go.mod h1:CYj3AtNIgw3nIlA9dTpKpmRqYrq6zKK7nwDQ6LUeLz8=
250250
github.com/dolthub/eventsapi_schema v0.0.0-20260205214132-a7a3c84c84a1 h1:QePoMpa5qlquwUqRVyF9KAHsJAlYbE2+eZkMPAxeBXc=
251251
github.com/dolthub/eventsapi_schema v0.0.0-20260205214132-a7a3c84c84a1/go.mod h1:evuptFmr/0/j0X/g+3cveHEEOM5tqyRA15FNgirtOY0=
252252
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 h1:u3PMzfF8RkKd3lB9pZ2bfn0qEG+1Gms9599cr0REMww=
@@ -255,8 +255,8 @@ github.com/dolthub/fslock v0.0.3 h1:iLMpUIvJKMKm92+N1fmHVdxJP5NdyDK5bK7z7Ba2s2U=
255255
github.com/dolthub/fslock v0.0.3/go.mod h1:QWql+P17oAAMLnL4HGB5tiovtDuAjdDTPbuqx7bYfa0=
256256
github.com/dolthub/go-icu-regex v0.0.0-20250916051405-78a38d478790 h1:zxMsH7RLiG+dlZ/y0LgJHTV26XoiSJcuWq+em6t6VVc=
257257
github.com/dolthub/go-icu-regex v0.0.0-20250916051405-78a38d478790/go.mod h1:F3cnm+vMRK1HaU6+rNqQrOCyR03HHhR1GWG2gnPOqaE=
258-
github.com/dolthub/go-mysql-server v0.20.1-0.20260220232524-cd9aa3651dba h1:iX3mr8RiKtQ5IjtM93gHcFZlhQ+vLxU7U8IDph9sfNE=
259-
github.com/dolthub/go-mysql-server v0.20.1-0.20260220232524-cd9aa3651dba/go.mod h1:LEWdXw6LKjdonOv2X808RpUc8wZVtQx4ZEPvmDWkvY4=
258+
github.com/dolthub/go-mysql-server v0.20.1-0.20260226225506-66cdd268afba h1:8CGtjW9j8nc5zcutPqDbztyluQpJmSZGu+WvmA5Wil8=
259+
github.com/dolthub/go-mysql-server v0.20.1-0.20260226225506-66cdd268afba/go.mod h1:Ip8uuT18T+T6kXiRHLluThFBiJZsgbJFsFp3VhdlT4Q=
260260
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63 h1:OAsXLAPL4du6tfbBgK0xXHZkOlos63RdKYS3Sgw/dfI=
261261
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63/go.mod h1:lV7lUeuDhH5thVGDCKXbatwKy2KW80L4rMT46n+Y2/Q=
262262
github.com/dolthub/ishell v0.0.0-20240701202509-2b217167d718 h1:lT7hE5k+0nkBdj/1UOSFwjWpNxf+LCApbRHgnCA17XE=
@@ -267,8 +267,8 @@ github.com/dolthub/pg_query_go/v6 v6.0.0-20251215122834-fb20be4254d1 h1:GY17cGA4
267267
github.com/dolthub/pg_query_go/v6 v6.0.0-20251215122834-fb20be4254d1/go.mod h1:qnrZP3/1slFl2Bq5yw38HLOsArZareGwdpEceriblLc=
268268
github.com/dolthub/sqllogictest/go v0.0.0-20240618184124-ca47f9354216 h1:JWkKRE4EHUcEVQCMRBej8DYxjYjRz/9MdF/NNQh0o70=
269269
github.com/dolthub/sqllogictest/go v0.0.0-20240618184124-ca47f9354216/go.mod h1:e/FIZVvT2IR53HBCAo41NjqgtEnjMJGKca3Y/dAmZaA=
270-
github.com/dolthub/vitess v0.0.0-20260202234501-b14ed9b1632b h1:B8QS0U5EHtJTiOptjti1cH/OiE6uczyhePtvVFigf3w=
271-
github.com/dolthub/vitess v0.0.0-20260202234501-b14ed9b1632b/go.mod h1:eLLslh1CSPMf89pPcaMG4yM72PQbTN9OUYJeAy0fAis=
270+
github.com/dolthub/vitess v0.0.0-20260225173707-20566e4abe9e h1:ZrRCF8F8Iq8RP0OBowkYpOwd/1NTFU34Ydp0MZ2qTq4=
271+
github.com/dolthub/vitess v0.0.0-20260225173707-20566e4abe9e/go.mod h1:eLLslh1CSPMf89pPcaMG4yM72PQbTN9OUYJeAy0fAis=
272272
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
273273
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
274274
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=

0 commit comments

Comments
 (0)