From 3d3e899241b78c701d1371e6debf733cdb1f8278 Mon Sep 17 00:00:00 2001 From: wshwsh12 <793703860@qq.com> Date: Thu, 4 Nov 2021 18:08:37 +0800 Subject: [PATCH] add test --- expression/integration_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/expression/integration_test.go b/expression/integration_test.go index 4883ea082d83e..7a2351e684a23 100644 --- a/expression/integration_test.go +++ b/expression/integration_test.go @@ -9937,6 +9937,19 @@ func (s *testIntegrationSuite) TestControlFunctionWithEnumOrSet(c *C) { tk.MustExec("insert into t values(1,1,1),(2,1,1),(1,1,1),(2,1,1);") tk.MustQuery("select if(A, null,b)=1 from t;").Check(testkit.Rows("", "", "", "")) tk.MustQuery("select if(A, null,b)='a' from t;").Check(testkit.Rows("", "", "", "")) + + // issue 29357 + tk.MustExec("drop table if exists t;") + tk.MustExec("create table t(`a` enum('y','b','Abc','null','1','2','0')) CHARSET=binary;") + tk.MustExec("insert into t values(\"1\");") + tk.MustQuery("SELECT count(*) from t where (null like 'a') = (case when cast('2015' as real) <=> round(\"1200\",\"1\") then a end);\n").Check(testkit.Rows("0")) + tk.MustQuery("SELECT (null like 'a') = (case when cast('2015' as real) <=> round(\"1200\",\"1\") then a end) from t;\n").Check(testkit.Rows("")) + tk.MustQuery("SELECT 5 = (case when 0 <=> 0 then a end) from t;").Check(testkit.Rows("1")) + tk.MustQuery("SELECT '1' = (case when 0 <=> 0 then a end) from t;").Check(testkit.Rows("1")) + tk.MustQuery("SELECT 5 = (case when 0 <=> 1 then a end) from t;").Check(testkit.Rows("")) + tk.MustQuery("SELECT '1' = (case when 0 <=> 1 then a end) from t;").Check(testkit.Rows("")) + tk.MustQuery("SELECT 5 = (case when 0 <=> 1 then a else a end) from t;").Check(testkit.Rows("1")) + tk.MustQuery("SELECT '1' = (case when 0 <=> 1 then a else a end) from t;").Check(testkit.Rows("1")) } func (s *testIntegrationSuite) TestComplexShowVariables(c *C) {