Merge pull request #824 from pingcap/coocood/fix-is-null-panic
plan/plans: fix is null panic.
This commit is contained in:
@ -244,7 +244,9 @@ func (r *TableDefaultPlan) filterIsNull(ctx context.Context, x *expression.IsNul
|
||||
cn := cns[0]
|
||||
t := r.T
|
||||
col := column.FindCol(t.Cols(), cn)
|
||||
|
||||
if col == nil {
|
||||
return r, false, nil
|
||||
}
|
||||
if col.IsPKHandleColumn(t.Meta()) {
|
||||
if x.Not {
|
||||
// PK handle column never be null.
|
||||
|
||||
@ -611,6 +611,8 @@ func (s *testSessionSuite) TestSelect(c *C) {
|
||||
row, err = r.FirstRow()
|
||||
c.Assert(err, IsNil)
|
||||
match(c, row, 3)
|
||||
|
||||
mustExecSQL(c, se, `select * from t1, t2 where t1.c1 is null`)
|
||||
}
|
||||
|
||||
func (s *testSessionSuite) TestSubQuery(c *C) {
|
||||
|
||||
Reference in New Issue
Block a user