Skip to content

Commit ef74b2d

Browse files
committed
new override logic
1 parent 995da01 commit ef74b2d

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

server/analyzer/init.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ func initEngine() {
117117
// There are a couple places during analysis where SplitConjunction in GMS cannot correctly split up
118118
// Doltgres expressions, so we need to override the default function used.
119119
analyzer.SplitConjunction = SplitConjunction
120-
analyzer.CostedIndexScanExpressionWalker = &LogicTreeWalker{}
121120
memo.SplitConjunction = SplitConjunction
122121
}
123122

server/analyzer/split.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ package analyzer
1616

1717
import (
1818
"github.com/dolthub/go-mysql-server/sql"
19-
"github.com/dolthub/go-mysql-server/sql/analyzer"
2019
"github.com/dolthub/go-mysql-server/sql/expression"
2120

2221
pgexprs "github.com/dolthub/doltgresql/server/expression"
@@ -53,9 +52,9 @@ func SplitConjunction(expr sql.Expression) []sql.Expression {
5352
// to apply indexes.
5453
type LogicTreeWalker struct{}
5554

56-
var _ analyzer.LogicTreeWalker = &LogicTreeWalker{}
55+
var _ sql.ExpressionTreeFilter = &LogicTreeWalker{}
5756

58-
// Next implements the analyzer.LogicTreeWalker interface.
57+
// Next implements the sql.ExpressionTreeFilter interface.
5958
func (l *LogicTreeWalker) Next(e sql.Expression) sql.Expression {
6059
switch expr := e.(type) {
6160
case *pgexprs.GMSCast:

servercfg/config.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"github.com/cockroachdb/errors"
1919
doltservercfg "github.com/dolthub/dolt/go/libraries/doltcore/servercfg"
2020
"github.com/dolthub/dolt/go/libraries/utils/filesys"
21+
"github.com/dolthub/doltgresql/server/analyzer"
2122
"github.com/dolthub/go-mysql-server/sql"
2223
"gopkg.in/yaml.v2"
2324

@@ -43,7 +44,8 @@ func (*DoltgresConfig) Overrides() sql.EngineOverrides {
4344
ParseTableAsColumn: expression.NewTableToComposite,
4445
Parser: pgsql.NewPostgresParser(),
4546
},
46-
SchemaFormatter: pgsql.NewPostgresSchemaFormatter(),
47+
SchemaFormatter: pgsql.NewPostgresSchemaFormatter(),
48+
CostedIndexScanExpressionFilter: &analyzer.LogicTreeWalker{},
4749
}
4850
}
4951

0 commit comments

Comments
 (0)