Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support enable verification #3

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/fuzzyduck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ void FuzzyDuck::BeginFuzzing() {
complete_log_handle =
fs.OpenFile(complete_log, FileFlags::FILE_FLAGS_WRITE | FileFlags::FILE_FLAGS_FILE_CREATE_NEW);
}
if (enable_verification) {
RunQuery("PRAGMA enable_verification");
}
}

void FuzzyDuck::EndFuzzing() {
Expand Down
1 change: 1 addition & 0 deletions src/include/fuzzyduck.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class FuzzyDuck {
string complete_log;
string log;
bool verbose_output = false;
bool enable_verification = false;
idx_t timeout = 30;

public:
Expand Down
5 changes: 5 additions & 0 deletions src/sqlsmith_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ struct SQLSmithFunctionData : public TableFunctionData {
bool dump_all_queries = false;
bool dump_all_graphs = false;
bool verbose_output = false;
bool enable_verification = false;
string complete_log;
string log;
bool finished = false;
Expand Down Expand Up @@ -67,6 +68,7 @@ static void SQLSmithFunction(ClientContext &context, TableFunctionInput &data_p,
options.dump_all_queries = data.dump_all_queries;
options.dump_all_graphs = data.dump_all_graphs;
options.verbose_output = data.verbose_output;
options.enable_verification = data.enable_verification;
options.complete_log = data.complete_log;
options.log = data.log;
duckdb_sqlsmith::run_sqlsmith(DatabaseInstance::GetDatabase(context), options);
Expand Down Expand Up @@ -139,6 +141,8 @@ static duckdb::unique_ptr<FunctionData> FuzzyDuckBind(ClientContext &context, Ta
result->fuzzer.log = StringValue::Get(kv.second);
} else if (kv.first == "verbose_output") {
result->fuzzer.verbose_output = BooleanValue::Get(kv.second);
} else if (kv.first == "enable_verification") {
result->fuzzer.enable_verification = BooleanValue::Get(kv.second);
}
}
return_types.emplace_back(LogicalType::BOOLEAN);
Expand Down Expand Up @@ -186,6 +190,7 @@ void SqlsmithExtension::Load(DuckDB &db) {
fuzzy_duck_fun.named_parameters["log"] = LogicalType::VARCHAR;
fuzzy_duck_fun.named_parameters["complete_log"] = LogicalType::VARCHAR;
fuzzy_duck_fun.named_parameters["verbose_output"] = LogicalType::BOOLEAN;
fuzzy_duck_fun.named_parameters["enable_verification"] = LogicalType::BOOLEAN;
ExtensionUtil::RegisterFunction(db_instance, fuzzy_duck_fun);

TableFunction fuzz_all_functions("fuzz_all_functions", {}, FuzzAllFunctions, FuzzyDuckBind);
Expand Down
1 change: 1 addition & 0 deletions src/third_party/sqlsmith/include/sqlsmith.hh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct SQLSmithOptions {
bool dump_all_queries = false;
bool dump_all_graphs = false;
bool verbose_output = false;
bool enable_verification = false;
std::string complete_log;
std::string log;
};
Expand Down
Loading