-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
expression: set a collation according to the arguments for
ifnull
i…
- Loading branch information
Showing
3 changed files
with
48 additions
and
1 deletion.
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
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,26 @@ | ||
drop table if exists t, t1; | ||
create table t (id varbinary(16)); | ||
create table t1(id char(16) charset utf8mb4 collate utf8mb4_general_ci); | ||
insert into t values (); | ||
insert into t1 values ("Hello World"); | ||
select collation(ifnull(concat(NULL),'~')); | ||
collation(ifnull(concat(NULL),'~')) | ||
utf8mb4_general_ci | ||
select collation(ifnull(concat(NULL),ifnull(concat(NULL),'~'))); | ||
collation(ifnull(concat(NULL),ifnull(concat(NULL),'~'))) | ||
utf8mb4_general_ci | ||
select collation(ifnull(concat(id),'~')) from t; | ||
collation(ifnull(concat(id),'~')) | ||
binary | ||
select collation(ifnull(concat(NULL),ifnull(concat(id),'~'))) from t; | ||
collation(ifnull(concat(NULL),ifnull(concat(id),'~'))) | ||
binary | ||
select collation(ifnull(concat(id),ifnull(concat(id),'~'))) from t; | ||
collation(ifnull(concat(id),ifnull(concat(id),'~'))) | ||
binary | ||
select collation(ifnull(concat(NULL),id)) from t1; | ||
collation(ifnull(concat(NULL),id)) | ||
utf8mb4_general_ci | ||
select collation(ifnull(concat(NULL),ifnull(concat(NULL),id))) from t1; | ||
collation(ifnull(concat(NULL),ifnull(concat(NULL),id))) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# TestFoldIfNull | ||
drop table if exists t, t1; | ||
create table t (id varbinary(16)); | ||
create table t1(id char(16) charset utf8mb4 collate utf8mb4_general_ci); | ||
insert into t values (); | ||
insert into t1 values ("Hello World"); | ||
select collation(ifnull(concat(NULL),'~')); | ||
select collation(ifnull(concat(NULL),ifnull(concat(NULL),'~'))); | ||
select collation(ifnull(concat(id),'~')) from t; | ||
select collation(ifnull(concat(NULL),ifnull(concat(id),'~'))) from t; | ||
select collation(ifnull(concat(id),ifnull(concat(id),'~'))) from t; | ||
select collation(ifnull(concat(NULL),id)) from t1; | ||
select collation(ifnull(concat(NULL),ifnull(concat(NULL),id))) from t1; |