From b6ae01ac6102c8530183fbe430cc225eb852c836 Mon Sep 17 00:00:00 2001 From: wjHuang Date: Thu, 3 Sep 2020 15:23:21 +0800 Subject: [PATCH] *: make 'cast' get the correct charset and collate (#15146) --- expression/integration_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/expression/integration_test.go b/expression/integration_test.go index bc65f74708..147658a50f 100755 --- a/expression/integration_test.go +++ b/expression/integration_test.go @@ -6350,6 +6350,13 @@ func (s *testIntegrationSerialSuite) TestCollateStringFunction(c *C) { tk.MustQuery("select FIND_IN_SET('a','b,a ,c,d' collate utf8mb4_bin);").Check(testkit.Rows("2")) tk.MustQuery("select FIND_IN_SET('a','b,A,c,d' collate utf8mb4_general_ci);").Check(testkit.Rows("2")) tk.MustQuery("select FIND_IN_SET('a','b,a ,c,d' collate utf8mb4_general_ci);").Check(testkit.Rows("2")) + + tk.MustExec("set names utf8mb4 collate utf8mb4_general_ci;") + tk.MustQuery("select collation(cast('a' as char));").Check(testkit.Rows("utf8mb4_general_ci")) + tk.MustQuery("select collation(cast('a' as binary));").Check(testkit.Rows("binary")) + tk.MustQuery("select collation(cast('a' collate utf8mb4_bin as char));").Check(testkit.Rows("utf8mb4_general_ci")) + tk.MustQuery("select collation(cast('a' collate utf8mb4_bin as binary));").Check(testkit.Rows("binary")) + tk.MustQuery("select FIND_IN_SET('a','b,A,c,d' collate utf8mb4_unicode_ci);").Check(testkit.Rows("2")) tk.MustQuery("select FIND_IN_SET('a','b,a ,c,d' collate utf8mb4_unicode_ci);").Check(testkit.Rows("2"))