Skip to content

Commit

Permalink
evaluator: fix a bug in checkInList.
Browse files Browse the repository at this point in the history
Fix a bug in checkInList.
  • Loading branch information
zxylvlp committed Mar 25, 2016
1 parent 8082314 commit 4947141
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions evaluator/evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ func (e *Evaluator) checkInList(not bool, in types.Datum, list []types.Datum) (d
d.SetInt64(1)
return d
}
d.SetInt64(0)
return d
}
}
Expand Down
4 changes: 4 additions & 0 deletions evaluator/evaluator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,10 @@ func (s *testEvaluatorSuite) TestExtract(c *C) {

func (s *testEvaluatorSuite) TestPatternIn(c *C) {
cases := []testCase{
{
exprStr: "1 not in (1, 2, 3)",
resultStr: "0",
},
{
exprStr: "1 in (1, 2, 3)",
resultStr: "1",
Expand Down

0 comments on commit 4947141

Please sign in to comment.