Skip to content

Commit

Permalink
use go-mysql-server condition evaluation logic
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Molina <[email protected]>
  • Loading branch information
erizocosmico committed Jun 24, 2019
1 parent 15eaf92 commit a2d94fb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Panic on query using EXPLODE ([#755](https://github.com/src-d/go-mysql-server/issues/755))
- Fixed error iterating over non ready repositories ([src-d/go-borges#54](https://github.com/src-d/go-borges/pull/54))
- Error saying value could not be converted to bool.

## [0.22.0-rc1] - 2019-06-21

Expand All @@ -24,10 +25,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- function: correctly transform up explode nodes ([#757](https://github.com/src-d/go-mysql-server/pull/757))
- function: correctly transform up explode nodes ([#757](https://github.com/src-d/go-mysql-server/pull/757))
- git libraries bare or non bare format is automatically detected ([#897](https://github.com/src-d/gitbase/pull/897))
- Fix bug that created multiple object cache with incorrect size ([#898](https://github.com/src-d/gitbase/pull/898))
- sql/expression: handle null values in arithmetic expressions ([#760](https://github.com/src-d/go-mysql-server/pull/760))
- sql/expression: handle null values in arithmetic expressions ([#760](https://github.com/src-d/go-mysql-server/pull/760))

## [0.22.0-beta1] - 2019-06-20

Expand All @@ -43,7 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- function: correctly transform up explode nodes ([#757](https://github.com/src-d/go-mysql-server/pull/757))
- function: correctly transform up explode nodes ([#757](https://github.com/src-d/go-mysql-server/pull/757))

## [0.21.0] - 2019-06-20

Expand Down
13 changes: 13 additions & 0 deletions integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,19 @@ func TestIntegration(t *testing.T) {
{"lordran.local", int64(1)},
},
},
{
`
SELECT file_path
FROM commit_files
NATURAL JOIN refs
WHERE ref_name = 'HEAD'
AND LANGUAGE(file_path) = 'Go';
`,
[]sql.Row{
{"go/example.go"},
{"vendor/foo.go"},
},
},
}

var pid uint64
Expand Down
12 changes: 1 addition & 11 deletions squash_iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -3486,17 +3486,7 @@ func (i *squashCommitFileBlobsIter) Close() error {
}

func evalFilters(ctx *sql.Context, row sql.Row, filters sql.Expression) (bool, error) {
v, err := filters.Eval(ctx, row)
if err != nil {
return false, err
}

v, err = sql.Boolean.Convert(v)
if err != nil {
return false, err
}

return v.(bool), nil
return sql.EvaluateCondition(ctx, filters, row)
}

var errInvalidCommit = errors.NewKind("invalid commit of type: %T")
Expand Down

0 comments on commit a2d94fb

Please sign in to comment.