Skip to content

Commit b04245f

Browse files
ilicmarkodbcloud-fan
authored andcommitted
[SPARK-53388][SQL][TESTS] Split collations.sql
### What changes were proposed in this pull request? In this PR, I propose splitting the `collations.sql` golden file into smaller files, so that in the future we can create new golden files for different testing purposes related to collations, instead of putting everything into a single test file. ### Why are the changes needed? Better testing. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing tests. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #52114 from ilicmarkodb/split_collations.sql. Authored-by: ilicmarkodb <marko.ilic@databricks.com> Signed-off-by: Wenchen Fan <wenchen@databricks.com>
1 parent a9d6919 commit b04245f

17 files changed

+10528
-9666
lines changed

sql/core/src/test/resources/sql-tests/analyzer-results/collations-aliases.sql.out

Lines changed: 335 additions & 0 deletions
Large diffs are not rendered by default.

sql/core/src/test/resources/sql-tests/analyzer-results/collations-basic.sql.out

Lines changed: 1164 additions & 0 deletions
Large diffs are not rendered by default.

sql/core/src/test/resources/sql-tests/analyzer-results/collations-padding-trim.sql.out

Lines changed: 690 additions & 0 deletions
Large diffs are not rendered by default.

sql/core/src/test/resources/sql-tests/analyzer-results/collations-string-functions.sql.out

Lines changed: 1510 additions & 0 deletions
Large diffs are not rendered by default.

sql/core/src/test/resources/sql-tests/analyzer-results/collations.sql.out

Lines changed: 0 additions & 3303 deletions
This file was deleted.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
-- test cases for implicit aliases to collated expression trees are correctly generated
2+
3+
create table t1(s string, utf8_binary string collate utf8_binary, utf8_lcase string collate utf8_lcase) using parquet;
4+
insert into t1 values ('Spark', 'Spark', 'SQL');
5+
insert into t1 values ('aaAaAAaA', 'aaAaAAaA', 'aaAaAAaA');
6+
insert into t1 values ('aaAaAAaA', 'aaAaAAaA', 'aaAaaAaA');
7+
insert into t1 values ('aaAaAAaA', 'aaAaAAaA', 'aaAaaAaAaaAaaAaAaaAaaAaA');
8+
insert into t1 values ('bbAbaAbA', 'bbAbAAbA', 'a');
9+
insert into t1 values ('İo', 'İo', 'İo');
10+
insert into t1 values ('İo', 'İo', 'İo ');
11+
insert into t1 values ('İo', 'İo ', 'İo');
12+
insert into t1 values ('İo', 'İo', 'i̇o');
13+
insert into t1 values ('efd2', 'efd2', 'efd2');
14+
insert into t1 values ('Hello, world! Nice day.', 'Hello, world! Nice day.', 'Hello, world! Nice day.');
15+
insert into t1 values ('Something else. Nothing here.', 'Something else. Nothing here.', 'Something else. Nothing here.');
16+
insert into t1 values ('kitten', 'kitten', 'sitTing');
17+
insert into t1 values ('abc', 'abc', 'abc');
18+
insert into t1 values ('abcdcba', 'abcdcba', 'aBcDCbA');
19+
20+
-- Simple select
21+
select concat_ws(' ', utf8_lcase, utf8_lcase) from t1;
22+
23+
-- Select by implicit alias
24+
select `concat_ws(' ' collate UTF8_LCASE, utf8_lcase, utf8_lcase)` from (
25+
select concat_ws(' ', utf8_lcase, utf8_lcase) from t1
26+
);
27+
28+
-- Select by star
29+
select * from (
30+
select concat_ws(' ', utf8_lcase, utf8_lcase) from t1
31+
);
32+
33+
-- Select by qualified star
34+
select subq1.* from (
35+
select concat_ws(' ', utf8_lcase, utf8_lcase) from t1
36+
) AS subq1;
37+
38+
-- Implicit alias in CTE output
39+
with cte as (
40+
select concat_ws(' ', utf8_lcase, utf8_lcase) from t1
41+
)
42+
select * from cte;
43+
44+
-- Implicit alias in EXISTS subquery output
45+
select * from values (1) where exists (
46+
select concat_ws(' ', utf8_lcase, utf8_lcase) from t1
47+
);
48+
49+
-- Implicit alias in scalar subquery output
50+
select (
51+
select concat_ws(' ', utf8_lcase, utf8_lcase) from t1 limit 1
52+
);
53+
54+
-- Scalar subquery with CTE with implicit alias
55+
select (
56+
with cte as (
57+
select concat_ws(' ', utf8_lcase, utf8_lcase) from t1
58+
)
59+
select * from cte limit 1
60+
);
61+
62+
-- Outer reference to implicit alias
63+
select * from (
64+
select concat_ws(' ', utf8_lcase, utf8_lcase) from t1 limit 1
65+
)
66+
where (
67+
`concat_ws(' ' collate UTF8_LCASE, utf8_lcase, utf8_lcase)` == 'aaa'
68+
);
69+
70+
-- Implicit alias reference in Sort
71+
select lower(`concat_ws(' ' collate UTF8_LCASE, utf8_lcase, utf8_lcase)`) from (
72+
select concat_ws(' ', utf8_lcase, utf8_lcase) from t1
73+
group by 1
74+
order by 1
75+
);
76+
77+
-- Implciit alias from aggregate in Sort
78+
select lower(`concat_ws(' ' collate UTF8_LCASE, utf8_lcase, utf8_lcase)`) from (
79+
select concat_ws(' ', utf8_lcase, utf8_lcase) from t1
80+
group by 1
81+
order by max(concat_ws(' ', utf8_lcase, utf8_lcase))
82+
);
83+
84+
-- Implicit alias in view schema
85+
create temporary view v1 as (
86+
select concat_ws(' ', utf8_lcase, utf8_lcase) from t1
87+
);
88+
89+
select * from v1;
90+
91+
select `concat_ws(' ' collate UTF8_LCASE, utf8_lcase, utf8_lcase)` from v1;
92+
93+
drop view v1;
94+
95+
drop table t1;
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
-- test cases for collation support
2+
3+
-- Create a test table with data
4+
create table t1(utf8_binary string collate utf8_binary, utf8_lcase string collate utf8_lcase) using parquet;
5+
insert into t1 values('aaa', 'aaa');
6+
insert into t1 values('AAA', 'AAA');
7+
insert into t1 values('bbb', 'bbb');
8+
insert into t1 values('BBB', 'BBB');
9+
10+
-- describe
11+
describe table t1;
12+
13+
-- group by and count utf8_binary
14+
select count(*) from t1 group by utf8_binary;
15+
16+
-- group by and count utf8_lcase
17+
select count(*) from t1 group by utf8_lcase;
18+
19+
-- filter equal utf8_binary
20+
select * from t1 where utf8_binary = 'aaa';
21+
22+
-- filter equal utf8_lcase
23+
select * from t1 where utf8_lcase = 'aaa' collate utf8_lcase;
24+
25+
-- filter less then utf8_binary
26+
select * from t1 where utf8_binary < 'bbb';
27+
28+
-- filter less then utf8_lcase
29+
select * from t1 where utf8_lcase < 'bbb' collate utf8_lcase;
30+
31+
-- inner join
32+
select l.utf8_binary, r.utf8_lcase from t1 l join t1 r on l.utf8_lcase = r.utf8_lcase;
33+
34+
-- create second table for anti-join
35+
create table t2(utf8_binary string collate utf8_binary, utf8_lcase string collate utf8_lcase) using parquet;
36+
insert into t2 values('aaa', 'aaa');
37+
insert into t2 values('bbb', 'bbb');
38+
39+
-- anti-join on lcase
40+
select * from t1 anti join t2 on t1.utf8_lcase = t2.utf8_lcase;
41+
42+
drop table t2;
43+
drop table t1;
44+
45+
-- set operations
46+
select col1 collate utf8_lcase from values ('aaa'), ('AAA'), ('bbb'), ('BBB'), ('zzz'), ('ZZZ') except select col1 collate utf8_lcase from values ('aaa'), ('bbb');
47+
select col1 collate utf8_lcase from values ('aaa'), ('AAA'), ('bbb'), ('BBB'), ('zzz'), ('ZZZ') except all select col1 collate utf8_lcase from values ('aaa'), ('bbb');
48+
select col1 collate utf8_lcase from values ('aaa'), ('AAA'), ('bbb'), ('BBB'), ('zzz'), ('ZZZ') union select col1 collate utf8_lcase from values ('aaa'), ('bbb');
49+
select col1 collate utf8_lcase from values ('aaa'), ('AAA'), ('bbb'), ('BBB'), ('zzz'), ('ZZZ') union all select col1 collate utf8_lcase from values ('aaa'), ('bbb');
50+
select col1 collate utf8_lcase from values ('aaa'), ('bbb'), ('BBB'), ('zzz'), ('ZZZ') intersect select col1 collate utf8_lcase from values ('aaa'), ('bbb');
51+
52+
-- set operations with conflicting collations
53+
select col1 collate utf8_lcase from values ('aaa'), ('AAA'), ('bbb'), ('BBB'), ('zzz'), ('ZZZ') except select col1 collate unicode_ci from values ('aaa'), ('bbb');
54+
select col1 collate utf8_lcase from values ('aaa'), ('AAA'), ('bbb'), ('BBB'), ('zzz'), ('ZZZ') except all select col1 collate unicode_ci from values ('aaa'), ('bbb');
55+
select col1 collate utf8_lcase from values ('aaa'), ('AAA'), ('bbb'), ('BBB'), ('zzz'), ('ZZZ') union select col1 collate unicode_ci from values ('aaa'), ('bbb');
56+
select col1 collate utf8_lcase from values ('aaa'), ('AAA'), ('bbb'), ('BBB'), ('zzz'), ('ZZZ') union all select col1 collate unicode_ci from values ('aaa'), ('bbb');
57+
select col1 collate utf8_lcase from values ('aaa'), ('bbb'), ('BBB'), ('zzz'), ('ZZZ') intersect select col1 collate unicode_ci from values ('aaa'), ('bbb');
58+
59+
-- create table with struct field
60+
create table t1 (c1 struct<utf8_binary: string collate utf8_binary, utf8_lcase: string collate utf8_lcase>) USING PARQUET;
61+
62+
insert into t1 values (named_struct('utf8_binary', 'aaa', 'utf8_lcase', 'aaa'));
63+
insert into t1 values (named_struct('utf8_binary', 'AAA', 'utf8_lcase', 'AAA'));
64+
65+
-- aggregate against nested field utf8_binary
66+
select count(*) from t1 group by c1.utf8_binary;
67+
68+
-- aggregate against nested field utf8_lcase
69+
select count(*) from t1 group by c1.utf8_lcase;
70+
71+
drop table t1;
72+
73+
-- array function tests
74+
select array_contains(ARRAY('aaa' collate utf8_lcase),'AAA' collate utf8_lcase);
75+
select array_position(ARRAY('aaa' collate utf8_lcase, 'bbb' collate utf8_lcase),'BBB' collate utf8_lcase);
76+
77+
-- utility
78+
select nullif('aaa' COLLATE utf8_lcase, 'AAA' COLLATE utf8_lcase);
79+
select least('aaa' COLLATE utf8_lcase, 'AAA' collate utf8_lcase, 'a' collate utf8_lcase);
80+
81+
-- array operations
82+
select arrays_overlap(array('aaa' collate utf8_lcase), array('AAA' collate utf8_lcase));
83+
select array_distinct(array('aaa' collate utf8_lcase, 'AAA' collate utf8_lcase));
84+
select array_union(array('aaa' collate utf8_lcase), array('AAA' collate utf8_lcase));
85+
select array_intersect(array('aaa' collate utf8_lcase), array('AAA' collate utf8_lcase));
86+
select array_except(array('aaa' collate utf8_lcase), array('AAA' collate utf8_lcase));
87+
88+
-- ICU collations (all statements return true)
89+
select 'a' collate unicode < 'A';
90+
select 'a' collate unicode_ci = 'A';
91+
select 'a' collate unicode_ai = 'å';
92+
select 'a' collate unicode_ci_ai = 'Å';
93+
select 'a' collate en < 'A';
94+
select 'a' collate en_ci = 'A';
95+
select 'a' collate en_ai = 'å';
96+
select 'a' collate en_ci_ai = 'Å';
97+
select 'Kypper' collate sv < 'Köpfe';
98+
select 'Kypper' collate de > 'Köpfe';
99+
select 'I' collate tr_ci = 'ı';
100+
101+
-- create table for str_to_map
102+
create table t3 (text string collate utf8_binary, pairDelim string collate utf8_lcase, keyValueDelim string collate utf8_binary) using parquet;
103+
104+
insert into t3 values('a:1,b:2,c:3', ',', ':');
105+
106+
select str_to_map(text, pairDelim, keyValueDelim) from t3;
107+
select str_to_map(text collate utf8_binary, pairDelim collate utf8_lcase, keyValueDelim collate utf8_binary) from t3;
108+
select str_to_map(text collate utf8_binary, pairDelim collate utf8_binary, keyValueDelim collate utf8_binary) from t3;
109+
select str_to_map(text collate unicode_ai, pairDelim collate unicode_ai, keyValueDelim collate unicode_ai) from t3;
110+
111+
drop table t3;
112+
113+
create table t1(s string, utf8_binary string collate utf8_binary, utf8_lcase string collate utf8_lcase) using parquet;
114+
insert into t1 values ('Spark', 'Spark', 'SQL');
115+
insert into t1 values ('aaAaAAaA', 'aaAaAAaA', 'aaAaAAaA');
116+
insert into t1 values ('aaAaAAaA', 'aaAaAAaA', 'aaAaaAaA');
117+
insert into t1 values ('aaAaAAaA', 'aaAaAAaA', 'aaAaaAaAaaAaaAaAaaAaaAaA');
118+
insert into t1 values ('bbAbaAbA', 'bbAbAAbA', 'a');
119+
insert into t1 values ('İo', 'İo', 'İo');
120+
insert into t1 values ('İo', 'İo', 'İo ');
121+
insert into t1 values ('İo', 'İo ', 'İo');
122+
insert into t1 values ('İo', 'İo', 'i̇o');
123+
insert into t1 values ('efd2', 'efd2', 'efd2');
124+
insert into t1 values ('Hello, world! Nice day.', 'Hello, world! Nice day.', 'Hello, world! Nice day.');
125+
insert into t1 values ('Something else. Nothing here.', 'Something else. Nothing here.', 'Something else. Nothing here.');
126+
insert into t1 values ('kitten', 'kitten', 'sitTing');
127+
insert into t1 values ('abc', 'abc', 'abc');
128+
insert into t1 values ('abcdcba', 'abcdcba', 'aBcDCbA');
129+
130+
create table t2(ascii double) using parquet;
131+
insert into t2 values (97.52143);
132+
insert into t2 values (66.421);
133+
134+
create table t3(utf8_binary string collate utf8_binary, utf8_lcase string collate utf8_lcase) using parquet;
135+
insert into t3 values ('aaAaAAaA', 'aaAaaAaA');
136+
insert into t3 values ('efd2', 'efd2');
137+
138+
create table t4(num long) using parquet;
139+
insert into t4 values (97);
140+
insert into t4 values (66);
141+
142+
-- Elt
143+
select elt(2, s, utf8_binary) from t1;
144+
select elt(2, utf8_binary, utf8_lcase, s) from t1;
145+
select elt(1, utf8_binary collate utf8_binary, utf8_lcase collate utf8_lcase) from t1;
146+
select elt(1, utf8_binary collate utf8_binary, utf8_lcase collate utf8_binary) from t1;
147+
select elt(1, utf8_binary collate utf8_binary, utf8_lcase) from t1;
148+
select elt(1, utf8_binary, 'word'), elt(1, utf8_lcase, 'word') from t1;
149+
select elt(1, utf8_binary, 'word' collate utf8_lcase), elt(1, utf8_lcase, 'word' collate utf8_binary) from t1;
150+
151+
-- Ascii & UnBase64 string expressions
152+
select ascii(utf8_binary), ascii(utf8_lcase) from t1;
153+
select ascii(utf8_binary collate utf8_lcase), ascii(utf8_lcase collate utf8_binary) from t1;
154+
select unbase64(utf8_binary), unbase64(utf8_lcase) from t3;
155+
select unbase64(utf8_binary collate utf8_lcase), unbase64(utf8_lcase collate utf8_binary) from t3;
156+
157+
-- Base64, Decode
158+
select base64(utf8_binary), base64(utf8_lcase) from t1;
159+
select base64(utf8_binary collate utf8_lcase), base64(utf8_lcase collate utf8_binary) from t1;
160+
select decode(encode(utf8_binary, 'utf-8'), 'utf-8'), decode(encode(utf8_lcase, 'utf-8'), 'utf-8') from t1;
161+
select decode(encode(utf8_binary collate utf8_lcase, 'utf-8'), 'utf-8'), decode(encode(utf8_lcase collate utf8_binary, 'utf-8'), 'utf-8') from t1;
162+
163+
-- FormatNumber
164+
select format_number(ascii, '###.###') from t2;
165+
select format_number(ascii, '###.###' collate utf8_lcase) from t2;
166+
167+
-- Encode, ToBinary
168+
select encode(utf8_binary, 'utf-8'), encode(utf8_lcase, 'utf-8') from t1;
169+
select encode(utf8_binary collate utf8_lcase, 'utf-8'), encode(utf8_lcase collate utf8_binary, 'utf-8') from t1;
170+
select to_binary(utf8_binary, 'utf-8'), to_binary(utf8_lcase, 'utf-8') from t1;
171+
select to_binary(utf8_binary collate utf8_lcase, 'utf-8'), to_binary(utf8_lcase collate utf8_binary, 'utf-8') from t1;
172+
173+
-- SoundEx
174+
select soundex(utf8_binary), soundex(utf8_lcase) from t1;
175+
select soundex(utf8_binary collate utf8_lcase), soundex(utf8_lcase collate utf8_binary) from t1;
176+
177+
-- Luhncheck
178+
select luhn_check(num) from t4;
179+
180+
-- Levenshtein
181+
select levenshtein(utf8_binary, utf8_lcase) from t1;
182+
select levenshtein(s, utf8_binary) from t1;
183+
select levenshtein(utf8_binary collate utf8_binary, s collate utf8_lcase) from t1;
184+
select levenshtein(utf8_binary, utf8_lcase collate utf8_binary) from t1;
185+
select levenshtein(utf8_binary collate utf8_lcase, utf8_lcase collate utf8_lcase) from t1;
186+
select levenshtein(utf8_binary, 'a'), levenshtein(utf8_lcase, 'a') from t1;
187+
select levenshtein(utf8_binary, 'AaAA' collate utf8_lcase, 3), levenshtein(utf8_lcase, 'AAa' collate utf8_binary, 4) from t1;
188+
189+
-- IsValidUTF8
190+
select is_valid_utf8(utf8_binary), is_valid_utf8(utf8_lcase) from t1;
191+
select is_valid_utf8(utf8_binary collate utf8_lcase), is_valid_utf8(utf8_lcase collate utf8_binary) from t1;
192+
select is_valid_utf8(utf8_binary collate utf8_lcase_rtrim), is_valid_utf8(utf8_lcase collate utf8_binary_rtrim) from t1;
193+
194+
-- MakeValidUTF8
195+
select make_valid_utf8(utf8_binary), make_valid_utf8(utf8_lcase) from t1;
196+
select make_valid_utf8(utf8_binary collate utf8_lcase), make_valid_utf8(utf8_lcase collate utf8_binary) from t1;
197+
select make_valid_utf8(utf8_binary collate utf8_lcase_rtrim), make_valid_utf8(utf8_lcase collate utf8_binary_rtrim) from t1;
198+
199+
-- ValidateUTF8
200+
select validate_utf8(utf8_binary), validate_utf8(utf8_lcase) from t1;
201+
select validate_utf8(utf8_binary collate utf8_lcase), validate_utf8(utf8_lcase collate utf8_binary) from t1;
202+
select validate_utf8(utf8_binary collate utf8_lcase_rtrim), validate_utf8(utf8_lcase collate utf8_binary_rtrim) from t1;
203+
204+
-- TryValidateUTF8
205+
select try_validate_utf8(utf8_binary), try_validate_utf8(utf8_lcase) from t1;
206+
select try_validate_utf8(utf8_binary collate utf8_lcase), try_validate_utf8(utf8_lcase collate utf8_binary) from t1;
207+
select try_validate_utf8(utf8_binary collate utf8_lcase_rtrim), try_validate_utf8(utf8_lcase collate utf8_binary_rtrim) from t1;
208+
209+
drop table t1;
210+
drop table t2;
211+
drop table t3;
212+
drop table t4;
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
-- test cases for padding and trimming with collations
2+
3+
create table t1(s string, utf8_binary string collate utf8_binary, utf8_lcase string collate utf8_lcase) using parquet;
4+
insert into t1 values ('Spark', 'Spark', 'SQL');
5+
insert into t1 values ('aaAaAAaA', 'aaAaAAaA', 'aaAaAAaA');
6+
insert into t1 values ('aaAaAAaA', 'aaAaAAaA', 'aaAaaAaA');
7+
insert into t1 values ('aaAaAAaA', 'aaAaAAaA', 'aaAaaAaAaaAaaAaAaaAaaAaA');
8+
insert into t1 values ('bbAbaAbA', 'bbAbAAbA', 'a');
9+
insert into t1 values ('İo', 'İo', 'İo');
10+
insert into t1 values ('İo', 'İo', 'İo ');
11+
insert into t1 values ('İo', 'İo ', 'İo');
12+
insert into t1 values ('İo', 'İo', 'i̇o');
13+
insert into t1 values ('efd2', 'efd2', 'efd2');
14+
insert into t1 values ('Hello, world! Nice day.', 'Hello, world! Nice day.', 'Hello, world! Nice day.');
15+
insert into t1 values ('Something else. Nothing here.', 'Something else. Nothing here.', 'Something else. Nothing here.');
16+
insert into t1 values ('kitten', 'kitten', 'sitTing');
17+
insert into t1 values ('abc', 'abc', 'abc');
18+
insert into t1 values ('abcdcba', 'abcdcba', 'aBcDCbA');
19+
20+
-- StringRPad
21+
select rpad(utf8_binary, 8, utf8_lcase) from t1;
22+
select rpad(s, 8, utf8_binary) from t1;
23+
select rpad(utf8_binary collate utf8_binary, 8, s collate utf8_lcase) from t1;
24+
select rpad(utf8_binary, 8, utf8_lcase collate utf8_binary) from t1;
25+
select rpad(utf8_binary collate utf8_lcase, 8, utf8_lcase collate utf8_lcase) from t1;
26+
select lpad(utf8_binary collate utf8_binary_rtrim, 8, utf8_lcase collate utf8_binary_rtrim) from t1;
27+
select rpad(utf8_binary, 8, 'a'), rpad(utf8_lcase, 8, 'a') from t1;
28+
select rpad(utf8_binary, 8, 'AaAA' collate utf8_lcase), rpad(utf8_lcase, 8, 'AAa' collate utf8_binary) from t1;
29+
30+
-- StringLPad
31+
select lpad(utf8_binary, 8, utf8_lcase) from t1;
32+
select lpad(s, 8, utf8_binary) from t1;
33+
select lpad(utf8_binary collate utf8_binary, 8, s collate utf8_lcase) from t1;
34+
select lpad(utf8_binary, 8, utf8_lcase collate utf8_binary) from t1;
35+
select lpad(utf8_binary collate utf8_lcase, 8, utf8_lcase collate utf8_lcase) from t1;
36+
select lpad(utf8_binary collate utf8_binary_rtrim, 8, utf8_lcase collate utf8_binary_rtrim) from t1;
37+
select lpad(utf8_binary, 8, 'a'), lpad(utf8_lcase, 8, 'a') from t1;
38+
select lpad(utf8_binary, 8, 'AaAA' collate utf8_lcase), lpad(utf8_lcase, 8, 'AAa' collate utf8_binary) from t1;
39+
40+
-- StringTrim
41+
select TRIM(utf8_binary, utf8_lcase) from t1;
42+
select TRIM(s, utf8_binary) from t1;
43+
select TRIM(utf8_binary collate utf8_binary, s collate utf8_lcase) from t1;
44+
select TRIM(utf8_binary, utf8_lcase collate utf8_binary) from t1;
45+
select TRIM(utf8_binary collate utf8_lcase, utf8_lcase collate utf8_lcase) from t1;
46+
select TRIM(utf8_binary collate unicode_ai, utf8_lcase collate unicode_ai) from t1;
47+
select TRIM(utf8_binary collate utf8_binary_rtrim, utf8_lcase collate utf8_binary_rtrim) from t1;
48+
select TRIM('ABc', utf8_binary), TRIM('ABc', utf8_lcase) from t1;
49+
select TRIM('ABc' collate utf8_lcase, utf8_binary), TRIM('AAa' collate utf8_binary, utf8_lcase) from t1;
50+
-- StringTrimBoth
51+
select BTRIM(utf8_binary, utf8_lcase) from t1;
52+
select BTRIM(s, utf8_binary) from t1;
53+
select BTRIM(utf8_binary collate utf8_binary, s collate utf8_lcase) from t1;
54+
select BTRIM(utf8_binary, utf8_lcase collate utf8_binary) from t1;
55+
select BTRIM(utf8_binary collate utf8_lcase, utf8_lcase collate utf8_lcase) from t1;
56+
select BTRIM(utf8_binary collate unicode_ai, utf8_lcase collate unicode_ai) from t1;
57+
select BTRIM(utf8_binary collate utf8_binary_rtrim, utf8_lcase collate utf8_binary_rtrim) from t1;
58+
select BTRIM('ABc', utf8_binary), BTRIM('ABc', utf8_lcase) from t1;
59+
select BTRIM('ABc' collate utf8_lcase, utf8_binary), BTRIM('AAa' collate utf8_binary, utf8_lcase) from t1;
60+
-- StringTrimLeft
61+
select LTRIM(utf8_binary, utf8_lcase) from t1;
62+
select LTRIM(s, utf8_binary) from t1;
63+
select LTRIM(utf8_binary collate utf8_binary, s collate utf8_lcase) from t1;
64+
select LTRIM(utf8_binary, utf8_lcase collate utf8_binary) from t1;
65+
select LTRIM(utf8_binary collate utf8_lcase, utf8_lcase collate utf8_lcase) from t1;
66+
select LTRIM(utf8_binary collate unicode_ai, utf8_lcase collate unicode_ai) from t1;
67+
select LTRIM(utf8_binary collate utf8_binary_rtrim, utf8_lcase collate utf8_binary_rtrim) from t1;
68+
select LTRIM('ABc', utf8_binary), LTRIM('ABc', utf8_lcase) from t1;
69+
select LTRIM('ABc' collate utf8_lcase, utf8_binary), LTRIM('AAa' collate utf8_binary, utf8_lcase) from t1;
70+
-- StringTrimRight
71+
select RTRIM(utf8_binary, utf8_lcase) from t1;
72+
select RTRIM(s, utf8_binary) from t1;
73+
select RTRIM(utf8_binary collate utf8_binary, s collate utf8_lcase) from t1;
74+
select RTRIM(utf8_binary, utf8_lcase collate utf8_binary) from t1;
75+
select RTRIM(utf8_binary collate utf8_lcase, utf8_lcase collate utf8_lcase) from t1;
76+
select RTRIM(utf8_binary collate unicode_ai, utf8_lcase collate unicode_ai) from t1;
77+
select RTRIM(utf8_binary collate utf8_binary_rtrim, utf8_lcase collate utf8_binary_rtrim) from t1;
78+
select RTRIM('ABc', utf8_binary), RTRIM('ABc', utf8_lcase) from t1;
79+
select RTRIM('ABc' collate utf8_lcase, utf8_binary), RTRIM('AAa' collate utf8_binary, utf8_lcase) from t1;
80+
81+
drop table t1;

0 commit comments

Comments
 (0)