Skip to content

Commit

Permalink
Migrate most enginetests for new name resolution (#1869)
Browse files Browse the repository at this point in the history
* starter

* fix integration plans for new name res

* [ga-format-pr] Run ./format_repo.sh to fix formatting

* progress

* drop constraint

* [ga-format-pr] Run ./format_repo.sh to fix formatting

* prog

* more tests

* [ga-format-pr] Run ./format_repo.sh to fix formatting

* test prog

* defaults and single alters

* [ga-format-pr] Run ./format_repo.sh to fix formatting

* scriptTests progress

* more fixes

* prog

* more fixes

* eng tests

* more DDL tests

* update joins

* read only tests

* update errors

* first pass of enginetests

* trigger resolve fallback

* more aliases

* no alias substitution

* prog

* enginetests passing

* [ga-format-pr] Run ./format_repo.sh to fix formatting

* unskip some tests

* delete comments

* fix indexing

* fix fulltext resolve

* [ga-format-pr] Run ./format_repo.sh to fix formatting

* zach's commentsg

* [ga-format-pr] Run ./format_repo.sh to fix formatting

---------

Co-authored-by: max-hoffman <max-hoffman@users.noreply.github.com>
  • Loading branch information
max-hoffman and max-hoffman authored Jul 28, 2023
1 parent f28984e commit 9b9301f
Show file tree
Hide file tree
Showing 95 changed files with 7,223 additions and 3,325 deletions.
15 changes: 7 additions & 8 deletions engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,6 @@ func (e *Engine) QueryNodeWithBindings(ctx *sql.Context, query string, parsed sq
switch ctx.Version {
case sql.VersionExperimental:
parsed, err = planbuilder.Parse(ctx, e.Analyzer.Catalog, query)
if err != nil {
ctx.Version = sql.VersionStable
parsed, err = parse.Parse(ctx, query)
}
default:
parsed, err = parse.Parse(ctx, query)
}
Expand Down Expand Up @@ -357,10 +353,13 @@ func (e *Engine) CloseSession(connID uint32) {

// Count number of BindVars in given tree
func countBindVars(node sql.Node) int {
bindCnt := 0
var bindVars map[string]bool
bindCntFunc := func(e sql.Expression) bool {
if _, ok := e.(*expression.BindVar); ok {
bindCnt++
if bv, ok := e.(*expression.BindVar); ok {
if bindVars == nil {
bindVars = make(map[string]bool)
}
bindVars[bv.Name] = true
}
return true
}
Expand All @@ -374,7 +373,7 @@ func countBindVars(node sql.Node) int {
}
return true
})
return bindCnt
return len(bindVars)
}

func (e *Engine) analyzeQuery(ctx *sql.Context, query string, parsed sql.Node, bindings map[string]sql.Expression) (sql.Node, error) {
Expand Down
Loading

0 comments on commit 9b9301f

Please sign in to comment.