Also copy or move PREWHERE to WHERE

This commit is contained in:
Alexander Gololobov 2023-01-12 14:11:30 +01:00
parent 2a92ae8d8e
commit 263a3f10c9

View File

@ -931,6 +931,19 @@ void QueryFuzzer::fuzz(ASTPtr & ast)
select->prewhere()->children.clear();
select->setExpression(ASTSelectQuery::Expression::PREWHERE, {});
}
else if (!select->where().get())
{
if (fuzz_rand() % 50 == 0)
{
select->setExpression(ASTSelectQuery::Expression::WHERE, select->prewhere()->clone());
if (fuzz_rand() % 2 == 0)
{
select->prewhere()->children.clear();
select->setExpression(ASTSelectQuery::Expression::PREWHERE, {});
}
}
}
}
else if (fuzz_rand() % 50 == 0)
{