mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Fuzz PREWHERE clause
This commit is contained in:
parent
6b6f5f9185
commit
2a92ae8d8e
@ -905,11 +905,38 @@ void QueryFuzzer::fuzz(ASTPtr & ast)
|
||||
select->where()->children.clear();
|
||||
select->setExpression(ASTSelectQuery::Expression::WHERE, {});
|
||||
}
|
||||
else if (!select->prewhere().get())
|
||||
{
|
||||
if (fuzz_rand() % 50 == 0)
|
||||
{
|
||||
select->setExpression(ASTSelectQuery::Expression::PREWHERE, select->where()->clone());
|
||||
|
||||
if (fuzz_rand() % 2 == 0)
|
||||
{
|
||||
select->where()->children.clear();
|
||||
select->setExpression(ASTSelectQuery::Expression::WHERE, {});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (fuzz_rand() % 50 == 0)
|
||||
{
|
||||
select->setExpression(ASTSelectQuery::Expression::WHERE, getRandomColumnLike());
|
||||
}
|
||||
|
||||
if (select->prewhere().get())
|
||||
{
|
||||
if (fuzz_rand() % 50 == 0)
|
||||
{
|
||||
select->prewhere()->children.clear();
|
||||
select->setExpression(ASTSelectQuery::Expression::PREWHERE, {});
|
||||
}
|
||||
}
|
||||
else if (fuzz_rand() % 50 == 0)
|
||||
{
|
||||
select->setExpression(ASTSelectQuery::Expression::PREWHERE, getRandomColumnLike());
|
||||
}
|
||||
|
||||
fuzzOrderByList(select->orderBy().get());
|
||||
|
||||
fuzz(select->children);
|
||||
|
Loading…
Reference in New Issue
Block a user