Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ require (
github.com/PuerkitoBio/goquery v1.8.1
github.com/cockroachdb/apd/v2 v2.0.3-0.20200518165714-d020e156310a
github.com/cockroachdb/errors v1.7.5
github.com/dolthub/dolt/go v0.40.5-0.20250217160730-872b69e2af01
github.com/dolthub/dolt/go v0.40.5-0.20250225182956-1d253fbf6e12
github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20241119094239-f4e529af734d
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2
github.com/dolthub/go-icu-regex v0.0.0-20241215010122-db690dd53c90
github.com/dolthub/go-mysql-server v0.19.1-0.20250214230802-dc03db8b1d93
github.com/dolthub/go-mysql-server v0.19.1-0.20250224212452-a3d336db732b
github.com/dolthub/sqllogictest/go v0.0.0-20240618184124-ca47f9354216
github.com/dolthub/vitess v0.0.0-20250214225328-a0ed4612b41c
github.com/fatih/color v1.13.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/dolthub/dolt/go v0.40.5-0.20250217160730-872b69e2af01 h1:jYxiS8l5o5nCKaMURWh3YT+e7m2qjezw/v1dUlToCSA=
github.com/dolthub/dolt/go v0.40.5-0.20250217160730-872b69e2af01/go.mod h1:avbJMbn3PDVuFGFL20ggP/b+34lSM+orqmxs04Geq4o=
github.com/dolthub/dolt/go v0.40.5-0.20250225182956-1d253fbf6e12 h1:CL8yflfdfihfJFU5RWmOS8E5i89BRk9rJjBdn6mROYY=
github.com/dolthub/dolt/go v0.40.5-0.20250225182956-1d253fbf6e12/go.mod h1:XPnBzUbFsZXbLolK6aCWuLWa/J+OGTJw+3OeuKEnT0Q=
github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20241119094239-f4e529af734d h1:gO9+wrmNHXukPNCO1tpfCcXIdMlW/qppbUStfLvqz/U=
github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20241119094239-f4e529af734d/go.mod h1:L5RDYZbC9BBWmoU2+TjTekeqqhFXX5EqH9ln00O0stY=
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2 h1:u3PMzfF8RkKd3lB9pZ2bfn0qEG+1Gms9599cr0REMww=
Expand All @@ -224,8 +224,8 @@ github.com/dolthub/fslock v0.0.3 h1:iLMpUIvJKMKm92+N1fmHVdxJP5NdyDK5bK7z7Ba2s2U=
github.com/dolthub/fslock v0.0.3/go.mod h1:QWql+P17oAAMLnL4HGB5tiovtDuAjdDTPbuqx7bYfa0=
github.com/dolthub/go-icu-regex v0.0.0-20241215010122-db690dd53c90 h1:Sni8jrP0sy/w9ZYXoff4g/ixe+7bFCZlfCqXKJSU+zM=
github.com/dolthub/go-icu-regex v0.0.0-20241215010122-db690dd53c90/go.mod h1:ylU4XjUpsMcvl/BKeRRMXSH7e7WBrPXdSLvnRJYrxEA=
github.com/dolthub/go-mysql-server v0.19.1-0.20250214230802-dc03db8b1d93 h1:RYb18gXSJFgch5pjwQTeacNm4S+PNKXutENF5wK5gqw=
github.com/dolthub/go-mysql-server v0.19.1-0.20250214230802-dc03db8b1d93/go.mod h1:JTlrabhq5TJqvlL+J3NKlm0EzTHQQugUAH6yAxWi4Ww=
github.com/dolthub/go-mysql-server v0.19.1-0.20250224212452-a3d336db732b h1:5/NOX/GNuXLYLJY5NPSgQaPW5M7aOr1wEmL4ataRI1o=
github.com/dolthub/go-mysql-server v0.19.1-0.20250224212452-a3d336db732b/go.mod h1:JTlrabhq5TJqvlL+J3NKlm0EzTHQQugUAH6yAxWi4Ww=
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63 h1:OAsXLAPL4du6tfbBgK0xXHZkOlos63RdKYS3Sgw/dfI=
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63/go.mod h1:lV7lUeuDhH5thVGDCKXbatwKy2KW80L4rMT46n+Y2/Q=
github.com/dolthub/ishell v0.0.0-20240701202509-2b217167d718 h1:lT7hE5k+0nkBdj/1UOSFwjWpNxf+LCApbRHgnCA17XE=
Expand Down
4 changes: 2 additions & 2 deletions server/functions/array.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ var array_recv = framework.Function3{
}
// The element data is everything from the offset to the next offset, excluding the null determinant
nextOffset := binary.LittleEndian.Uint32(data[(i+2)*4:])
o, err := baseType.DeserializeValue(data[offset+1 : nextOffset])
o, err := baseType.DeserializeValue(ctx, data[offset+1:nextOffset])
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -230,7 +230,7 @@ var array_send = framework.Function1{
binary.LittleEndian.PutUint32(offsets[i*4:], currentOffset)
// Handle serialization of the value
// TODO: ARRAYs may be multidimensional, such as ARRAY[[4,2],[6,3]], which isn't accounted for here
serializedVal, err := baseType.SerializeValue(vals[i])
serializedVal, err := baseType.SerializeValue(ctx, vals[i])
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion server/functions/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ var domain_recv = framework.Function3{
t := pgtypes.IDToBuiltInDoltgresType[id.Type(baseTypeOid)]
typmod := val3.(int32)
t = t.WithAttTypMod(typmod)
return t.DeserializeValue(data)
return t.DeserializeValue(ctx, data)
},
}
15 changes: 4 additions & 11 deletions server/tables/dtables/ignore.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (

"github.com/cockroachdb/errors"
"github.com/dolthub/dolt/go/libraries/doltcore/doltdb"
"github.com/dolthub/dolt/go/store/prolly/tree"
"github.com/dolthub/dolt/go/store/val"
"github.com/dolthub/go-mysql-server/sql"

Expand All @@ -36,7 +35,7 @@ func getDoltIgnoreSchema() sql.Schema {
}

// convertTupleToIgnoreBoolean reads a boolean from a tuple and returns it.
func convertTupleToIgnoreBoolean(valueDesc val.TupleDesc, valueTuple val.Tuple) (bool, error) {
func convertTupleToIgnoreBoolean(ctx context.Context, valueDesc val.TupleDesc, valueTuple val.Tuple) (bool, error) {
extendedTuple := val.NewTupleDescriptorWithArgs(
val.TupleDescriptorArgs{Comparator: valueDesc.Comparator(), Handlers: valueDesc.Handlers},
val.Type{Enc: val.ExtendedEnc, Nullable: false},
Expand All @@ -48,7 +47,7 @@ func convertTupleToIgnoreBoolean(valueDesc val.TupleDesc, valueTuple val.Tuple)
if !ok {
return false, errors.Errorf("could not read boolean")
}
val, err := valueDesc.Handlers[0].DeserializeValue(extended)
val, err := valueDesc.Handlers[0].DeserializeValue(ctx, extended)
if err != nil {
return false, err
}
Expand All @@ -60,7 +59,7 @@ func convertTupleToIgnoreBoolean(valueDesc val.TupleDesc, valueTuple val.Tuple)
}

// getIgnoreTablePatternKey reads the pattern key from a tuple and returns it.
func getIgnoreTablePatternKey(keyDesc val.TupleDesc, keyTuple val.Tuple, ns tree.NodeStore) (string, error) {
func getIgnoreTablePatternKey(ctx context.Context, keyDesc val.TupleDesc, keyTuple val.Tuple) (string, error) {
extendedTuple := val.NewTupleDescriptorWithArgs(
val.TupleDescriptorArgs{Comparator: keyDesc.Comparator(), Handlers: keyDesc.Handlers},
val.Type{Enc: val.ExtendedAddrEnc, Nullable: false},
Expand All @@ -74,13 +73,7 @@ func getIgnoreTablePatternKey(keyDesc val.TupleDesc, keyTuple val.Tuple, ns tree
return "", fmt.Errorf("could not read pattern")
}

var b []byte
b, err := tree.NewByteArray(keyAddr, ns).ToBytes(context.Background())
if err != nil {
return "", err
}

key, err := keyDesc.Handlers[0].DeserializeValue(b)
key, err := keyDesc.Handlers[0].DeserializeValue(ctx, keyAddr[:])
if err != nil {
return "", err
}
Expand Down
7 changes: 4 additions & 3 deletions server/types/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package types
import (
"bytes"
"cmp"
"context"
"fmt"
"math"
"reflect"
Expand Down Expand Up @@ -588,7 +589,7 @@ func (t *DoltgresType) SendFuncName() string {
}

// SerializedCompare implements the types.ExtendedType interface.
func (t *DoltgresType) SerializedCompare(v1 []byte, v2 []byte) (int, error) {
func (t *DoltgresType) SerializedCompare(ctx context.Context, v1 []byte, v2 []byte) (int, error) {
if len(v1) == 0 && len(v2) == 0 {
return 0, nil
} else if len(v1) > 0 && len(v2) == 0 {
Expand Down Expand Up @@ -800,7 +801,7 @@ func (t *DoltgresType) Zero() interface{} {
}

// SerializeValue implements the types.ExtendedType interface.
func (t *DoltgresType) SerializeValue(val any) ([]byte, error) {
func (t *DoltgresType) SerializeValue(ctx context.Context, val any) ([]byte, error) {
if val == nil {
return nil, nil
}
Expand All @@ -821,7 +822,7 @@ func (t *DoltgresType) SerializeValue(val any) ([]byte, error) {
}

// DeserializeValue implements the types.ExtendedType interface.
func (t *DoltgresType) DeserializeValue(val []byte) (any, error) {
func (t *DoltgresType) DeserializeValue(ctx context.Context, val []byte) (any, error) {
if len(val) == 0 {
return nil, nil
}
Expand Down
12 changes: 12 additions & 0 deletions servercfg/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ type DoltgresBehaviorConfig struct {
DoltTransactionCommit *bool `yaml:"dolt_transaction_commit,omitempty" minver:"0.7.4"`
}

// Implements dolt servercfg.AutoGCBehavior.
type DoltgresAutoGCBehavior struct {
}

func (DoltgresAutoGCBehavior) Enable() bool {
return false
}

type DoltgresUserConfig struct {
Name *string `yaml:"name,omitempty" minver:"0.7.4"`
Password *string `yaml:"password,omitempty" minver:"0.7.4"`
Expand Down Expand Up @@ -447,6 +455,10 @@ func (cfg *DoltgresConfig) EventSchedulerStatus() string {
return "OFF"
}

func (cfg *DoltgresConfig) AutoGCBehavior() servercfg.AutoGCBehavior {
return DoltgresAutoGCBehavior{}
}

func (cfg *DoltgresConfig) ValueSet(value string) bool {
switch value {
case readTimeoutKey:
Expand Down
1 change: 0 additions & 1 deletion testing/go/enginetest/doltgres_engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,6 @@ func TestDeleteFrom(t *testing.T) {
h := newDoltgresServerHarness(t).WithSkippedQueries([]string{
"DELETE FROM mytable ORDER BY i DESC LIMIT 1 OFFSET 1;", // offset is unsupported syntax
"DELETE FROM mytable WHERE (i,s) = (1, 'first row');", // type error, needs investigation
"DELETE FROM mytable WHERE s = 'first row';", // index lookup error
"with t (n) as (select (1) from dual) delete from mytable where i in (select n from t)",
"with recursive t (n) as (select (1) from dual union all select n + 1 from t where n < 2) delete from mytable where i in (select n from t)",
})
Expand Down
Loading