MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / getGlobalASTFuzzer

Function getGlobalASTFuzzer

src/Interpreters/executeQuery.cpp:1999–2011  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1997
1998
1999std::pair<std::shared_ptr<QueryFuzzer>, std::unique_lock<std::mutex>> getGlobalASTFuzzer()
2000{
2001 static std::mutex mutex;
2002#if WITH_COVERAGE
2003 /// Under LLVM coverage builds we use a fixed seed so that the set of AST mutations
2004 /// (and therefore the set of branches taken inside `QueryFuzzer`) is stable run-to-run.
2005 /// Without this, coverage of `QueryFuzzer.cpp` and friends flickers between coverage runs.
2006 static std::shared_ptr<QueryFuzzer> fuzzer = std::make_shared<QueryFuzzer>(pcg64(0xC0FFEEULL));
2007#else
2008 static std::shared_ptr<QueryFuzzer> fuzzer = std::make_shared<QueryFuzzer>(randomSeed());
2009#endif
2010 return {fuzzer, std::unique_lock(mutex)};
2011}
2012
2013
2014static bool isReadOnlyQuery(const ASTPtr & ast)

Callers 3

executeASTFuzzerQueriesFunction · 0.85
executeImplMethod · 0.85
fuzzVectorMethod · 0.85

Calls 1

randomSeedFunction · 0.85

Tested by

no test coverage detected