Skip to content

Commit

Permalink
Fix problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Algunenano committed Jan 30, 2024
1 parent 299c390 commit 4b5e992
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions src/Client/QueryFuzzer.cpp
Expand Up @@ -916,38 +916,29 @@ ASTPtr QueryFuzzer::fuzzLiteralUnderExpressionList(ASTPtr child)
}

if (fuzz_rand() % 11 == 0)
{
String value = l->value.get<String>();
child = makeASTFunction("toNullable", child);
}

if (fuzz_rand() % 11 == 0)
{
String value = l->value.get<String>();
child = makeASTFunction("toLowCardinality", child);
}

if (fuzz_rand() % 11 == 0)
{
String value = l->value.get<String>();
child = makeASTFunction("materialize", child);
}

return child;
}


void QueryFuzzer::fuzzExpressionList(ASTExpressionList & expr_list)
{
for (size_t i = 0; i < expr_list.children.size(); i++)
for (auto & child : expr_list.children)
{
if (auto * literal = typeid_cast<ASTLiteral *>(expr_list.children[i].get()))
if (auto * literal = typeid_cast<ASTLiteral *>(child.get()))
{
if (fuzz_rand() % 13 == 0)
expr_list.children[i] = fuzzLiteralUnderExpressionList(expr_list.children[i]);
child = fuzzLiteralUnderExpressionList(child);
}
else
fuzz(expr_list.children[i]);
fuzz(child);
}
}

Expand Down

0 comments on commit 4b5e992

Please sign in to comment.