forked from pingcap/tidb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
charset: support builtin function convert (pingcap#28943)
- Loading branch information
1 parent
8d9647d
commit ad85341
Showing
7 changed files
with
204 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
drop table if exists t; | ||
create table t(a char(10) collate utf8mb4_unicode_ci, b char(10) collate utf8mb4_general_ci); | ||
insert into t values ('啊', '撒旦'); | ||
select coercibility(concat(a, b)) from t; | ||
coercibility(concat(a, b)) | ||
1 | ||
select coercibility(convert(concat(a, b) using utf8mb4) collate utf8mb4_general_ci) from t; | ||
coercibility(convert(concat(a, b) using utf8mb4) collate utf8mb4_general_ci) | ||
0 | ||
select coercibility(convert('a' using utf8mb4)); | ||
coercibility(convert('a' using utf8mb4)) | ||
2 | ||
select coercibility(convert('a' using utf8mb4) collate utf8mb4_general_ci); | ||
coercibility(convert('a' using utf8mb4) collate utf8mb4_general_ci) | ||
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--disable_warnings | ||
drop table if exists t; | ||
--enable_warnings | ||
create table t(a char(10) collate utf8mb4_unicode_ci, b char(10) collate utf8mb4_general_ci); | ||
insert into t values ('啊', '撒旦'); | ||
select coercibility(concat(a, b)) from t; | ||
select coercibility(convert(concat(a, b) using utf8mb4) collate utf8mb4_general_ci) from t; | ||
select coercibility(convert('a' using utf8mb4)); | ||
select coercibility(convert('a' using utf8mb4) collate utf8mb4_general_ci); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters