MCPcopy Create free account
hub / github.com/duckdb/duckdb / LLVMFuzzerTestOneInput

Function LLVMFuzzerTestOneInput

test/ossfuzz/parse_fuzz_test.cpp:6–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include <unordered_set>
5
6extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
7 std::string input(reinterpret_cast<const char *>(data), size);
8 duckdb::DuckDB db(nullptr);
9 duckdb::Connection con(db);
10
11 std::unordered_set<std::string> internal_error_messages = {"Unoptimized Result differs from original result!",
12 "INTERNAL"};
13 con.Query("PRAGMA enable_verification");
14 try {
15 auto result = con.Query(input);
16 if (result->HasError()) {
17 for (auto &internal_error : internal_error_messages) {
18 if (duckdb::StringUtil::Contains(result->GetError(), internal_error)) {
19 return 1;
20 }
21 }
22 }
23 } catch (std::exception &e) {
24 }
25 return 0;
26}

Callers

nothing calls this directly

Calls 4

ContainsFunction · 0.85
QueryMethod · 0.45
HasErrorMethod · 0.45
GetErrorMethod · 0.45

Tested by

no test coverage detected