Skip to content

Commit e75d21b

Browse files
authored
pass schema name for function (#11109)
1 parent 0e2e48d commit e75d21b

4 files changed

Lines changed: 5 additions & 4 deletions

File tree

go/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ require (
6464
github.com/dolthub/dolt-mcp v0.3.4
6565
github.com/dolthub/eventsapi_schema v0.0.0-20260310172945-37a9265ade69
6666
github.com/dolthub/flatbuffers/v23 v23.3.3-dh.2
67-
github.com/dolthub/go-mysql-server v0.20.1-0.20260528221811-29886bb10b26
67+
github.com/dolthub/go-mysql-server v0.20.1-0.20260529165710-0c9baca7aa28
6868
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63
6969
github.com/edsrzf/mmap-go v1.2.0
7070
github.com/esote/minmaxheap v1.0.0

go/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ github.com/dolthub/fslock v0.0.4 h1:p0FcUPu81bO53349qPT1im7XyGu3CwZDsB0PEVdFcaE=
214214
github.com/dolthub/fslock v0.0.4/go.mod h1:895XJNoMTlL5N1TjOJbd9Pnpjtv1DW/Ddw9qShcAYsM=
215215
github.com/dolthub/go-icu-regex v0.0.0-20260412212219-49724d547866 h1:U6gSf5I0e6h6GP1/5Sa7D2lWW1CWfcVPtY5wkyHq6jY=
216216
github.com/dolthub/go-icu-regex v0.0.0-20260412212219-49724d547866/go.mod h1:F3cnm+vMRK1HaU6+rNqQrOCyR03HHhR1GWG2gnPOqaE=
217-
github.com/dolthub/go-mysql-server v0.20.1-0.20260528221811-29886bb10b26 h1:CFR0vFhNJO9Q5LyPulyQhmbiUzPYKxbFCKnR/fBkwT4=
218-
github.com/dolthub/go-mysql-server v0.20.1-0.20260528221811-29886bb10b26/go.mod h1:UTL4UvG/y8PMBcI8I60gf0DH4YPBALW/8UQCcvft95Y=
217+
github.com/dolthub/go-mysql-server v0.20.1-0.20260529165710-0c9baca7aa28 h1:7/u3ZCuzvCLF7u8oE3ZhdqhtXHnjXIf7fsdqevHa7ms=
218+
github.com/dolthub/go-mysql-server v0.20.1-0.20260529165710-0c9baca7aa28/go.mod h1:UTL4UvG/y8PMBcI8I60gf0DH4YPBALW/8UQCcvft95Y=
219219
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63 h1:OAsXLAPL4du6tfbBgK0xXHZkOlos63RdKYS3Sgw/dfI=
220220
github.com/dolthub/gozstd v0.0.0-20240423170813-23a2903bca63/go.mod h1:lV7lUeuDhH5thVGDCKXbatwKy2KW80L4rMT46n+Y2/Q=
221221
github.com/dolthub/ishell v0.0.0-20260414231531-5f031e3e9037 h1:oIW9HwuWrhxv+4HZxA+QQSKHLqWFyXZ2FmNjUYwkdiM=

go/libraries/doltcore/sqle/database_provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1622,7 +1622,7 @@ func (p *DoltDatabaseProvider) SessionDatabase(ctx *sql.Context, name string) (d
16221622
}
16231623

16241624
// Function implements the FunctionProvider interface
1625-
func (p *DoltDatabaseProvider) Function(_ *sql.Context, name string) (sql.Function, bool) {
1625+
func (p *DoltDatabaseProvider) Function(_ *sql.Context, schema, name string) (sql.Function, bool) {
16261626
fn, ok := p.functions[strings.ToLower(name)]
16271627
if !ok {
16281628
return nil, false

go/libraries/doltcore/sqle/writer/schema_cache.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ func newWriterSchema(ctx *sql.Context, t *doltdb.Table, tableName string, dbName
9898
PrefixLengths: def.PrefixLengths(),
9999
}
100100
if predStr := def.Predicate(); predStr != "" {
101+
// TODO: need to set the schema in search_path? it cannot find tables and types.
101102
predExpr, err := expranalysis.ResolvePredicateExpression(ctx, tableName, predStr)
102103
if err != nil {
103104
return nil, fmt.Errorf("failed to compile partial index predicate for %s: %w", def.Name(), err)

0 commit comments

Comments
 (0)