From e7bdfbdc8d59e92209027b6ab4c12171ee97f400 Mon Sep 17 00:00:00 2001 From: yisaer Date: Thu, 17 Mar 2022 15:05:54 +0800 Subject: [PATCH 1/3] fix 33070 Signed-off-by: yisaer --- executor/executor_test.go | 3 +++ expression/builtin_other.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/executor/executor_test.go b/executor/executor_test.go index f3d46e60d0169..a3b982a77f9c4 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -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.QueryToErr("select * from t where id in (-1, -2)") + c.Assert(err, NotNil) + c.Assert(err.Error(), Equals, "Incorrect parameter count in the call to native function 'in'") } func (s *testSuite) TestDeleteWithMulTbl(c *C) { diff --git a/expression/builtin_other.go b/expression/builtin_other.go index fa4b7d6485bb3..9ffd17b96b7d6 100644 --- a/expression/builtin_other.go +++ b/expression/builtin_other.go @@ -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 } From 0872c0a6a2efdbc121862ac729e7f1c7fc5d99c2 Mon Sep 17 00:00:00 2001 From: yisaer Date: Thu, 17 Mar 2022 15:50:50 +0800 Subject: [PATCH 2/3] fix 33070 Signed-off-by: yisaer --- executor/executor_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/executor/executor_test.go b/executor/executor_test.go index a3b982a77f9c4..2e19903204327 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -8520,7 +8520,7 @@ 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.QueryToErr("select * from t where id in (-1, -2)") + err := tk.ExecToErr("select * from t where id in (-1, -2)") c.Assert(err, NotNil) c.Assert(err.Error(), Equals, "Incorrect parameter count in the call to native function 'in'") } From 27865ec0e67757e86a6aded07d4e6dccdeb6b2e0 Mon Sep 17 00:00:00 2001 From: yisaer Date: Thu, 17 Mar 2022 16:09:07 +0800 Subject: [PATCH 3/3] fix 33070 Signed-off-by: yisaer --- executor/executor_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/executor/executor_test.go b/executor/executor_test.go index 2e19903204327..179bb2301b6e2 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -8522,7 +8522,7 @@ func (s *testSuite1) TestBitColumnIn(c *C) { 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, "Incorrect parameter count in the call to native function 'in'") + c.Assert(err.Error(), Equals, "[expression:1582]Incorrect parameter count in the call to native function 'in'") } func (s *testSuite) TestDeleteWithMulTbl(c *C) {