mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 04:12:19 +00:00
Added a test
This commit is contained in:
parent
d38e9ee229
commit
cc0157b293
@ -85,7 +85,7 @@ private:
|
||||
char_data += num_chars;
|
||||
}
|
||||
|
||||
if constexpr (mode::trim_left)
|
||||
if constexpr (mode::trim_right)
|
||||
{
|
||||
const char * found = find_last_not_symbols_or_null<' '>(char_data, char_end);
|
||||
if (found)
|
||||
|
0
dbms/tests/queries/0_stateless/00997_trim.reference
Normal file
0
dbms/tests/queries/0_stateless/00997_trim.reference
Normal file
20
dbms/tests/queries/0_stateless/00997_trim.sql
Normal file
20
dbms/tests/queries/0_stateless/00997_trim.sql
Normal file
@ -0,0 +1,20 @@
|
||||
WITH
|
||||
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' AS x,
|
||||
replaceRegexpAll(x, '.', ' ') AS spaces,
|
||||
concat(substring(spaces, 1, rand(1) % 62), substring(x, 1, rand(2) % 62), substring(spaces, 1, rand(3) % 62)) AS s,
|
||||
trimLeft(s) AS sl,
|
||||
trimRight(s) AS sr,
|
||||
trimBoth(s) AS t,
|
||||
replaceRegexpOne(s, '^ +', '') AS slr,
|
||||
replaceRegexpOne(s, ' +$', '') AS srr,
|
||||
replaceRegexpOne(s, '^ *(.*?) *$', '\\1') AS tr
|
||||
SELECT
|
||||
replaceAll(s, ' ', '_'),
|
||||
replaceAll(sl, ' ', '_'),
|
||||
replaceAll(slr, ' ', '_'),
|
||||
replaceAll(sr, ' ', '_'),
|
||||
replaceAll(srr, ' ', '_'),
|
||||
replaceAll(t, ' ', '_'),
|
||||
replaceAll(tr, ' ', '_')
|
||||
FROM numbers(100000)
|
||||
WHERE NOT ((sl = slr) AND (sr = srr) AND (t = tr))
|
Loading…
Reference in New Issue
Block a user