-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3cb3e18
commit 01793a4
Showing
7 changed files
with
226 additions
and
19 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
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
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 |
---|---|---|
@@ -1,16 +1,117 @@ | ||
mysql> drop table if exists test.t; | ||
mysql> create table test.t(a varchar(30) charset utf8mb4 collate utf8mb4_general_ci, b varchar(30) charset utf8mb4 collate utf8mb4_general_ci); | ||
mysql> alter table test.t set tiflash replica 1; | ||
mysql> insert into test.t values ('abc', 'ABC'),('Abc', 'abc'),('def', 'dEf'); | ||
mysql> insert into test.t values ('abc', 'ABC'),('Abc', 'abc'),('def', 'dEf'), ('a', 'A'), ('b', 'B'), ('c', 'C'), (NULL, NULL), ('a', NULL), (NULL, 'a'), ('', NULL), (NULL, ''), ('', ''); | ||
func> wait_table test t | ||
|
||
>> DBGInvoke __try_flush() | ||
|
||
mysql> set session tidb_isolation_read_engines='tiflash'; select /*+ read_from_storage(tiflash[t]) */ count(*) from test.t where strcmp(a, b) = 0; | ||
+----------+ | ||
| count(*) | | ||
+----------+ | ||
| 3 | | ||
+----------+ | ||
mysql> set tidb_enforce_mpp=1; select a, b, strcmp(a, b) from test.t; | ||
+------+------+--------------+ | ||
| a | b | strcmp(a, b) | | ||
+------+------+--------------+ | ||
| abc | ABC | 0 | | ||
| Abc | abc | 0 | | ||
| def | dEf | 0 | | ||
| a | A | 0 | | ||
| b | B | 0 | | ||
| c | C | 0 | | ||
| NULL | NULL | NULL | | ||
| a | NULL | NULL | | ||
| NULL | a | NULL | | ||
| | NULL | NULL | | ||
| NULL | | NULL | | ||
| | | 0 | | ||
+------+------+--------------+ | ||
|
||
mysql> set tidb_enforce_mpp=1; select a, b, strcmp('b', a) from test.t; | ||
+------+------+----------------+ | ||
| a | b | strcmp('b', a) | | ||
+------+------+----------------+ | ||
| abc | ABC | 1 | | ||
| Abc | abc | 1 | | ||
| def | dEf | -1 | | ||
| a | A | 1 | | ||
| b | B | 0 | | ||
| c | C | -1 | | ||
| NULL | NULL | NULL | | ||
| a | NULL | 1 | | ||
| NULL | a | NULL | | ||
| | NULL | 1 | | ||
| NULL | | NULL | | ||
| | | 1 | | ||
+------+------+----------------+ | ||
|
||
mysql> set tidb_enforce_mpp=1; select a, b, strcmp(a, 'b') from test.t; | ||
+------+------+----------------+ | ||
| a | b | strcmp(a, 'b') | | ||
+------+------+----------------+ | ||
| abc | ABC | -1 | | ||
| Abc | abc | -1 | | ||
| def | dEf | 1 | | ||
| a | A | -1 | | ||
| b | B | 0 | | ||
| c | C | 1 | | ||
| NULL | NULL | NULL | | ||
| a | NULL | -1 | | ||
| NULL | a | NULL | | ||
| | NULL | -1 | | ||
| NULL | | NULL | | ||
| | | -1 | | ||
+------+------+----------------+ | ||
|
||
mysql> set tidb_enforce_mpp=1; select a, b, strcmp('b', b) from test.t; | ||
+------+------+----------------+ | ||
| a | b | strcmp('b', b) | | ||
+------+------+----------------+ | ||
| abc | ABC | 1 | | ||
| Abc | abc | 1 | | ||
| def | dEf | -1 | | ||
| a | A | 1 | | ||
| b | B | 0 | | ||
| c | C | -1 | | ||
| NULL | NULL | NULL | | ||
| a | NULL | NULL | | ||
| NULL | a | 1 | | ||
| | NULL | NULL | | ||
| NULL | | 1 | | ||
| | | 1 | | ||
+------+------+----------------+ | ||
|
||
mysql> set tidb_enforce_mpp=1; select a, b, strcmp(b, 'b') from test.t; | ||
+------+------+----------------+ | ||
| a | b | strcmp(b, 'b') | | ||
+------+------+----------------+ | ||
| abc | ABC | -1 | | ||
| Abc | abc | -1 | | ||
| def | dEf | 1 | | ||
| a | A | -1 | | ||
| b | B | 0 | | ||
| c | C | 1 | | ||
| NULL | NULL | NULL | | ||
| a | NULL | NULL | | ||
| NULL | a | -1 | | ||
| | NULL | NULL | | ||
| NULL | | -1 | | ||
| | | -1 | | ||
+------+------+----------------+ | ||
|
||
mysql> set tidb_enforce_mpp=1; select a, b, strcmp(NULL, a) from test.t; | ||
+------+------+-----------------+ | ||
| a | b | strcmp(NULL, a) | | ||
+------+------+-----------------+ | ||
| abc | ABC | NULL | | ||
| Abc | abc | NULL | | ||
| def | dEf | NULL | | ||
| a | A | NULL | | ||
| b | B | NULL | | ||
| c | C | NULL | | ||
| NULL | NULL | NULL | | ||
| a | NULL | NULL | | ||
| NULL | a | NULL | | ||
| | NULL | NULL | | ||
| NULL | | NULL | | ||
| | | NULL | | ||
+------+------+-----------------+ | ||
|
||
mysql> drop table if exists test.t |