diff --git a/CHANGELOG.md b/CHANGELOG.md index 7104903cf..36551e0ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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 @@ -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 diff --git a/integration_test.go b/integration_test.go index f3c956e12..f763296ee 100644 --- a/integration_test.go +++ b/integration_test.go @@ -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 diff --git a/squash_iterator.go b/squash_iterator.go index b45b3ae5f..a0759add9 100644 --- a/squash_iterator.go +++ b/squash_iterator.go @@ -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")