Merge pull request #824 from pingcap/coocood/fix-is-null-panic

plan/plans: fix is null panic.
This commit is contained in:
Ewan Chou
2016-01-04 16:35:39 +08:00
2 changed files with 5 additions and 1 deletions

View File

@ -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.

View File

@ -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) {