mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 07:01:59 +00:00
More tests
This commit is contained in:
parent
0db5ec9227
commit
bd3c9833c4
@ -226,3 +226,6 @@ o, пр
|
||||
lo, п
|
||||
lo, п
|
||||
lo, п
|
||||
1
|
||||
1
|
||||
1
|
||||
|
@ -25,3 +25,18 @@ SELECT substringUTF8(materialize('hello, привет'), 1, 10) FROM numbers(3);
|
||||
SELECT substringUTF8(materialize('hello, привет'), 5, 5) FROM numbers(3);
|
||||
SELECT substringUTF8(materialize('hello, привет'), -5) FROM numbers(3);
|
||||
SELECT substringUTF8(materialize('hello, привет'), -10, 5) FROM numbers(3);
|
||||
|
||||
SELECT DISTINCT substring(toString(range(rand(1) % 50)), rand(2) % 50, rand(3) % 50) = substringUTF8(toString(range(rand(1) % 50)), rand(2) % 50, rand(3) % 50) AS res FROM numbers(1000000);
|
||||
SELECT DISTINCT substring(toString(range(rand(1) % 50)), rand(2) % 50) = substringUTF8(toString(range(rand(1) % 50)), rand(2) % 50) AS res FROM numbers(1000000);
|
||||
|
||||
-- NOTE: The behaviour of substring and substringUTF8 is inconsistent when negative offset is greater than string size:
|
||||
-- substring:
|
||||
-- hello
|
||||
-- ^-----^ - offset -10, length 7, result: "he"
|
||||
-- substringUTF8:
|
||||
-- hello
|
||||
-- ^-----^ - offset -10, length 7, result: "hello"
|
||||
|
||||
-- SELECT DISTINCT substring(toString(range(rand(1) % 50)), -(rand(2) % 50), rand(3) % 50) = substringUTF8(toString(range(rand(1) % 50)), -(rand(2) % 50), rand(3) % 50) AS res FROM numbers(1000000);
|
||||
|
||||
SELECT DISTINCT substring(toString(range(rand(1) % 50)), -(rand(2) % 50)) = substringUTF8(toString(range(rand(1) % 50)), -(rand(2) % 50)) AS res FROM numbers(1000000);
|
||||
|
Loading…
Reference in New Issue
Block a user