Merge pull request #953 from pingcap/shenli/fix-sqllogic
*: Add Coerce before compare for PatternInExpr
This commit is contained in:
@ -384,7 +384,7 @@ func (e *Evaluator) checkInList(not bool, in interface{}, list []interface{}) in
|
||||
continue
|
||||
}
|
||||
|
||||
r, err := types.Compare(in, v)
|
||||
r, err := types.Compare(types.Coerce(in, v))
|
||||
if err != nil {
|
||||
e.err = errors.Trace(err)
|
||||
return nil
|
||||
|
||||
@ -677,6 +677,10 @@ func (s *testEvaluatorSuite) TestPatternIn(c *C) {
|
||||
exprStr: "2 in (1, NULL)",
|
||||
resultStr: "<nil>",
|
||||
},
|
||||
{
|
||||
exprStr: "(-(23)++46/51*+51) in (+23)",
|
||||
resultStr: "0",
|
||||
},
|
||||
}
|
||||
s.runTests(c, cases)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user