mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 00:52:02 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
18 lines
822 B
SQL
18 lines
822 B
SQL
select match('a key="v" ', 'key="(.*?)"');
|
|
select match(materialize('a key="v" '), 'key="(.*?)"');
|
|
|
|
select match('\0 key="v" ', 'key="(.*?)"');
|
|
select match(materialize('\0 key="v" '), 'key="(.*?)"');
|
|
|
|
select multiMatchAny('\0 key="v" ', ['key="(.*?)"']);
|
|
select multiMatchAny(materialize('\0 key="v" '), ['key="(.*?)"']);
|
|
|
|
select unhex('34') || ' key="v" ' as haystack, length(haystack), extract( haystack, 'key="(.*?)"') as needle;
|
|
-- works, result = v
|
|
|
|
select unhex('00') || ' key="v" ' as haystack, length(haystack), extract( haystack, 'key="(.*?)"') as needle;
|
|
-- before fix: returns nothing (zero-byte in the begining of haystack)
|
|
|
|
select number as char_code, extract( char(char_code) || ' key="v" ' as haystack, 'key="(.*?)"') as needle from numbers(256);
|
|
-- every other chars codes (except of zero byte) works ok
|