diff --git a/tests/queries/0_stateless/01681_hyperscan_debug_assertion.reference b/tests/queries/0_stateless/01681_hyperscan_debug_assertion.reference index e69de29bb2d..7326d960397 100644 --- a/tests/queries/0_stateless/01681_hyperscan_debug_assertion.reference +++ b/tests/queries/0_stateless/01681_hyperscan_debug_assertion.reference @@ -0,0 +1 @@ +Ok diff --git a/tests/queries/0_stateless/01681_hyperscan_debug_assertion.sh b/tests/queries/0_stateless/01681_hyperscan_debug_assertion.sh new file mode 100755 index 00000000000..0bbf8942c1a --- /dev/null +++ b/tests/queries/0_stateless/01681_hyperscan_debug_assertion.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +CLICKHOUSE_CLIENT_SERVER_LOGS_LEVEL=fatal + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +# shellcheck source=../shell_config.sh +. "$CURDIR"/../shell_config.sh + +# We throw our own exception from operator new. +# In previous versions of Hyperscan it triggered debug assertion as it only expected std::bad_alloc. + +M=1000000 + +while true +do + $CLICKHOUSE_CLIENT --allow_hyperscan 1 --max_memory_usage $M --format Null --query " + SELECT [1, 2, 3, 11] = arraySort(multiMatchAllIndices('фабрикант', ['', 'рикан', 'а', 'f[a${RANDOM}e]b[ei]rl', 'ф[иа${RANDOM}эе]б[еэи][рпл]', 'афиукд', 'a[f${RANDOM}t],th', '^ф[аие${RANDOM}э]?б?[еэи]?$', 'бе${RANDOM}рлик', 'fa${RANDOM}b', 'фа[беьв]+е?[рл${RANDOM}ко]'])) + " 2>&1 | grep -q 'Memory limit' || break; + + M=$((M + 100000)) +done + +echo 'Ok' diff --git a/tests/queries/0_stateless/01681_hyperscan_debug_assertion.sql b/tests/queries/0_stateless/01681_hyperscan_debug_assertion.sql deleted file mode 100644 index ac88c58b30f..00000000000 --- a/tests/queries/0_stateless/01681_hyperscan_debug_assertion.sql +++ /dev/null @@ -1,6 +0,0 @@ --- We throw our own exception from operator new. --- In previous versions of Hyperscan it triggered debug assertion as it only expected std::bad_alloc. - -SET allow_hyperscan = 1; -SET max_memory_usage = 4000000; -SELECT [1, 2, 3, 11] = arraySort(multiMatchAllIndices('фабрикант', ['', 'рикан', 'а', 'f[ae]b[ei]rl', 'ф[иаэе]б[еэи][рпл]', 'афиукд', 'a[ft],th', '^ф[аиеэ]?б?[еэи]?$', 'берлик', 'fab', 'фа[беьв]+е?[рлко]'])); -- { serverError 241 }