Skip to content

Commit a2d94fb

Browse files
committed
use go-mysql-server condition evaluation logic
Signed-off-by: Miguel Molina <[email protected]>
1 parent 15eaf92 commit a2d94fb

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

CHANGELOG.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
### Fixed
1010
- Panic on query using EXPLODE ([#755](https://github.com/src-d/go-mysql-server/issues/755))
1111
- Fixed error iterating over non ready repositories ([src-d/go-borges#54](https://github.com/src-d/go-borges/pull/54))
12+
- Error saying value could not be converted to bool.
1213

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

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

2526
### Fixed
2627

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

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

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

4445
### Fixed
4546

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

4849
## [0.21.0] - 2019-06-20
4950

integration_test.go

+13
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,19 @@ func TestIntegration(t *testing.T) {
496496
{"lordran.local", int64(1)},
497497
},
498498
},
499+
{
500+
`
501+
SELECT file_path
502+
FROM commit_files
503+
NATURAL JOIN refs
504+
WHERE ref_name = 'HEAD'
505+
AND LANGUAGE(file_path) = 'Go';
506+
`,
507+
[]sql.Row{
508+
{"go/example.go"},
509+
{"vendor/foo.go"},
510+
},
511+
},
499512
}
500513

501514
var pid uint64

squash_iterator.go

+1-11
Original file line numberDiff line numberDiff line change
@@ -3486,17 +3486,7 @@ func (i *squashCommitFileBlobsIter) Close() error {
34863486
}
34873487

34883488
func evalFilters(ctx *sql.Context, row sql.Row, filters sql.Expression) (bool, error) {
3489-
v, err := filters.Eval(ctx, row)
3490-
if err != nil {
3491-
return false, err
3492-
}
3493-
3494-
v, err = sql.Boolean.Convert(v)
3495-
if err != nil {
3496-
return false, err
3497-
}
3498-
3499-
return v.(bool), nil
3489+
return sql.EvaluateCondition(ctx, filters, row)
35003490
}
35013491

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

0 commit comments

Comments
 (0)