mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Merge pull request #35524 from Avogar/fix-stack-overflow
Decrease data_type_max_parse_depth a little to avoid stack overflow in coroutines
This commit is contained in:
commit
44b6ea5564
@ -33,7 +33,7 @@ DataTypePtr DataTypeFactory::get(const String & full_name) const
|
|||||||
/// Value 315 is known to cause stack overflow in some test configurations (debug build, sanitizers)
|
/// Value 315 is known to cause stack overflow in some test configurations (debug build, sanitizers)
|
||||||
/// let's make the threshold significantly lower.
|
/// let's make the threshold significantly lower.
|
||||||
/// It is impractical for user to have complex data types with this depth.
|
/// It is impractical for user to have complex data types with this depth.
|
||||||
static constexpr size_t data_type_max_parse_depth = 200;
|
static constexpr size_t data_type_max_parse_depth = 150;
|
||||||
|
|
||||||
ParserDataType parser;
|
ParserDataType parser;
|
||||||
ASTPtr ast = parseQuery(parser, full_name.data(), full_name.data() + full_name.size(), "data type", 0, data_type_max_parse_depth);
|
ASTPtr ast = parseQuery(parser, full_name.data(), full_name.data() + full_name.size(), "data type", 0, data_type_max_parse_depth);
|
||||||
|
@ -1 +1,2 @@
|
|||||||
Ok
|
Ok
|
||||||
|
Ok
|
||||||
|
@ -16,3 +16,15 @@ done
|
|||||||
|
|
||||||
#echo "I = ${I}"
|
#echo "I = ${I}"
|
||||||
echo 'Ok'
|
echo 'Ok'
|
||||||
|
|
||||||
|
counter=0
|
||||||
|
I=0
|
||||||
|
while [[ $counter -lt $retries ]]; do
|
||||||
|
I=$((I + 1))
|
||||||
|
TYPE=$(perl -e "print 'Array(' x $I; print 'UInt8'; print ')' x $I")
|
||||||
|
${CLICKHOUSE_CLIENT} --prefer_localhost_replica=0 --max_parser_depth 1000000 --query "SELECT * FROM remote('127.0.0.{1,2}', generateRandom('x $TYPE', 1, 1, 1)) LIMIT 1 FORMAT Null" 2>&1 | grep -q -F 'Maximum parse depth' && break;
|
||||||
|
((++counter))
|
||||||
|
done
|
||||||
|
|
||||||
|
#echo "I = ${I}"
|
||||||
|
echo 'Ok'
|
||||||
|
Loading…
Reference in New Issue
Block a user