Skip to content

Commit a6141cd

Browse files
authored
Fix/convert to bool (#907)
Fix/convert to bool
2 parents 5d4e9d5 + ad31a53 commit a6141cd

File tree

5 files changed

+21
-17
lines changed

5 files changed

+21
-17
lines changed

Diff for: 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

Diff for: go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ require (
1717
github.com/src-d/go-borges v0.0.0-20190624135448-6ee47472d565
1818
github.com/src-d/go-git v4.7.0+incompatible
1919
github.com/src-d/go-git-fixtures v3.5.1-0.20190605154830-57f3972b0248+incompatible
20-
github.com/src-d/go-mysql-server v0.4.1-0.20190624094722-bc2334894674
20+
github.com/src-d/go-mysql-server v0.4.1-0.20190624135918-d9b20c8d6b72
2121
github.com/stretchr/testify v1.3.0
2222
github.com/uber-go/atomic v1.4.0 // indirect
2323
github.com/uber/jaeger-client-go v2.16.0+incompatible

Diff for: go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ github.com/src-d/go-git v4.7.0+incompatible h1:IYSSnbAHeKmsfbQFi9ozbid+KNh0bKjlo
225225
github.com/src-d/go-git v4.7.0+incompatible/go.mod h1:1bQciz+hn0jzPQNsYj0hDFZHLJBdV7gXE2mWhC7EkFk=
226226
github.com/src-d/go-git-fixtures v3.5.1-0.20190605154830-57f3972b0248+incompatible h1:A5bKevhs9C//Nh8QV0J+1KphEaIa25cDe1DTs/yPxDI=
227227
github.com/src-d/go-git-fixtures v3.5.1-0.20190605154830-57f3972b0248+incompatible/go.mod h1:XcIQp7L+k0pgfTqfbaTKj3kxlBv8kYOKZ/tKNXbZFLg=
228-
github.com/src-d/go-mysql-server v0.4.1-0.20190624094722-bc2334894674 h1:pzziN+eE0Z4p6gTOuOpgId5v47Y7DVwJ/y5KPFCqcsM=
229-
github.com/src-d/go-mysql-server v0.4.1-0.20190624094722-bc2334894674/go.mod h1:GO8SmBnN9LcKSXy6DYuBbqKtJvrRnHsBrlXvlVOX+NM=
228+
github.com/src-d/go-mysql-server v0.4.1-0.20190624135918-d9b20c8d6b72 h1:mdRElTdq3BLiI+olROiWjf4oCmOzWW9PzHYhLMVM5QA=
229+
github.com/src-d/go-mysql-server v0.4.1-0.20190624135918-d9b20c8d6b72/go.mod h1:GO8SmBnN9LcKSXy6DYuBbqKtJvrRnHsBrlXvlVOX+NM=
230230
github.com/src-d/go-oniguruma v1.0.0 h1:JDk5PUAjreGsGAKLsoDLNmrsaryjJ5RqT3h+Si6aw/E=
231231
github.com/src-d/go-oniguruma v1.0.0/go.mod h1:chVbff8kcVtmrhxtZ3yBVLLquXbzCS6DrxQaAK/CeqM=
232232
github.com/src-d/go-oniguruma v1.1.0 h1:EG+Nm5n2JqWUaCjtM0NtutPxU7ZN5Tp50GWrrV8bTww=

Diff for: 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

Diff for: 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)