Skip to content

Commit

Permalink
expr: fix nil panic for In function with bit column (#33204)
Browse files Browse the repository at this point in the history
close #33070
  • Loading branch information
Yisaer authored Mar 21, 2022
1 parent cd9c04a commit f9beb51
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8520,6 +8520,9 @@ func (s *testSuite1) TestBitColumnIn(c *C) {
tk.MustExec("create table t (id bit(16), key id(id))")
tk.MustExec("insert into t values (65)")
tk.MustQuery("select * from t where id not in (-1,2)").Check(testkit.Rows("\x00A"))
err := tk.ExecToErr("select * from t where id in (-1, -2)")
c.Assert(err, NotNil)
c.Assert(err.Error(), Equals, "[expression:1582]Incorrect parameter count in the call to native function 'in'")
}

func (s *testSuite) TestDeleteWithMulTbl(c *C) {
Expand Down
2 changes: 1 addition & 1 deletion expression/builtin_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (c *inFunctionClass) verifyArgs(ctx sessionctx.Context, args []Expression)
}
validatedArgs = append(validatedArgs, arg)
}
err := c.baseFunctionClass.verifyArgs(args)
err := c.baseFunctionClass.verifyArgs(validatedArgs)
return validatedArgs, err
}

Expand Down

0 comments on commit f9beb51

Please sign in to comment.