*: make 'cast' get the correct charset and collate (#15146)
This commit is contained in:
@ -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"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user