-
Notifications
You must be signed in to change notification settings - Fork 594
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
Showing
3 changed files
with
158 additions
and
5 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,108 @@ | ||
statement ok | ||
SET RW_IMPLICIT_FLUSH TO true; | ||
|
||
# collate in select | ||
|
||
query T | ||
select 'a' collate "C"; | ||
---- | ||
a | ||
|
||
query B | ||
select 'a' < 'b' collate "C"; | ||
---- | ||
t | ||
|
||
query B | ||
select 'b' < 'a' collate "POSIX"; | ||
---- | ||
f | ||
|
||
query T | ||
select (varchar 't') collate "C"; | ||
---- | ||
t | ||
|
||
# case-sensitive | ||
statement error | ||
select 'a' collate "c"; | ||
|
||
# case-sensitive | ||
statement error | ||
select 'a' collate "posix"; | ||
|
||
# case-sensitive | ||
statement error | ||
select 'a' collate "pOsIx"; | ||
|
||
query BT | ||
select 'a' < 'b', 'a' collate "C"; | ||
---- | ||
t a | ||
|
||
query B | ||
select 'a' < ('b' collate "C"); | ||
---- | ||
t | ||
|
||
query B | ||
select '1' collate "C" > 2; | ||
---- | ||
f | ||
|
||
query B | ||
select ('1' collate "C") = 1; | ||
---- | ||
t | ||
|
||
query I | ||
select '10' collate "C" - 1; | ||
---- | ||
9 | ||
|
||
# only `text`, 'varchar' and `char` are built-in collatable types (in PostgreSQL) | ||
# the type of `('a' < 'b')` is Bool, it SHOULD be failed, | ||
statement error | ||
select ('a' < 'b') collate "C"; | ||
|
||
statement error | ||
select 123 collate "C"; | ||
|
||
# parser issue | ||
statement error | ||
select varchar 't' collate "C"; | ||
|
||
statement error | ||
select 'a' collate "Invalid"; | ||
|
||
# collate in create table | ||
|
||
statement ok | ||
create table t1 ( | ||
a text collate "C", | ||
b int | ||
); | ||
|
||
statement ok | ||
create table t2 ( | ||
a text collate "POSIX", | ||
b int | ||
); | ||
|
||
statement error | ||
create table t3 ( | ||
a text collate "pOsIx", | ||
b int | ||
); | ||
|
||
statement error | ||
create table t4 ( | ||
a text collate "POSIX", | ||
b int collate "C" | ||
); | ||
|
||
statement ok | ||
drop table t1; | ||
|
||
statement ok | ||
drop table t2; |
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