AST-based query fuzzing mode for clickhouse-client#12111
Merged
Conversation
programs/client/QueryFuzzer.h
Outdated
| struct QueryFuzzer | ||
| { | ||
| //pcg64 fuzz_rand{static_cast<UInt64>(rand())}; | ||
| pcg64 fuzz_rand{clock_gettime_ns()}; |
Member
There was a problem hiding this comment.
There is randomSeed function.
Member
|
Please link all the issues found by this fuzzer to let people know how good this tool is. |
Contributor
Author
Added the list of issues to the changelog entry. The tests are green and I cleaned up the code, so merging now. Next step is to start running it in the CI. |
| std::cerr << "Read too much text and still can't parse a query." | ||
| " Aborting." << std::endl; | ||
| last_exception_received_from_server | ||
| = std::make_unique<Exception>(1, "~"); |
Member
There was a problem hiding this comment.
This will require cleanups.
| // Debug AST cloning errors. | ||
| if (base_before_fuzz != base_after_fuzz) | ||
| { | ||
| fprintf(stderr, "base before fuzz: %s\n" |
Member
There was a problem hiding this comment.
It represents you as a seasoned C developer.
| ("highlight", po::value<bool>()->default_value(true), "enable or disable basic syntax highlight in interactive command line") | ||
| ("log-level", po::value<std::string>(), "client log level") | ||
| ("server_logs_file", po::value<std::string>(), "put server logs into specified file") | ||
| ("query-fuzzer-runs", po::value<int>()->default_value(0), "query fuzzer runs") |
Member
There was a problem hiding this comment.
Minimal comment about usage is required.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Implement AST-based query fuzzing mode for clickhouse-client. See this label for the list of issues we recently found by fuzzing. Most of them were found by this tool, and a couple by SQLancer and
00746_sql_fuzzy.pl.