ClickHouse/tests
Robert Schulze 81bb2242fd
Fix countSubstrings() & position() on patterns with 0-bytes
SQL functions countSubstrings(), countSubstringsCaseInsensitive(),
countSubstringsUTF8(), position(), positionCaseInsensitive(),
positionUTF8() with non-const pattern argument use fallback sorters
LibCASCIICaseSensitiveStringSearcher and LibCASCIICaseInsensitiveStringSearcher
which call ::strstr(), resp. ::strcasestr(). These functions assume that
the haystack is 0-terminated and they even document that. However, the
callers did not check if the haystack contains 0-byte (perhaps because
its sort of expensive). As a consequence, if the haystack contained a
zero byte in it's payload, matches behind this zero byte were ignored.

    create table t (id UInt32, pattern String) engine = MergeTree() order by id;
    insert into t values (1, 'x');
    select countSubstrings('aaaxxxaa\0xxx', pattern) from t;

We returned 3 before this commit, now we return 6
2022-06-29 21:41:18 +00:00
..
ci Merge pull request #38548 from excitoon-favorites/ci-integration-tests-test 2022-06-29 11:18:53 +02:00
config Merge branch 'master' into deprecate_ordinary_database 2022-06-27 23:47:49 +02:00
fuzz
instructions
integration Merge pull request #38486 from azat/fix-parts-removal 2022-06-29 14:17:59 +03:00
jepsen.clickhouse-keeper Add perf tests to all jepsen runs 2022-06-15 12:11:23 +00:00
perf_drafts
performance Merge pull request #38335 from ClickHouse/deprecate_ordinary_database 2022-06-29 13:42:59 +03:00
queries Fix countSubstrings() & position() on patterns with 0-bytes 2022-06-29 21:41:18 +00:00
.gitignore
clickhouse-test Merge branch 'master' into deprecate_ordinary_database 2022-06-28 15:40:33 +02:00
CMakeLists.txt
msan_suppressions.txt
stress
tsan_suppressions.txt
ubsan_suppressions.txt