Add WIP version of query reconstruction from AST This work-in-progress, it doesn't work yet for all the presented tests cases. The current work reveals that changes are required in the AST itself for performing a proper/simpler reconstruction of some nodes.#1
Open
renecannao wants to merge 12 commits intomainfrom
Open
Add WIP version of query reconstruction from AST
This work-in-progress, it doesn't work yet for all the presented tests
cases. The current work reveals that changes are required in the AST
itself for performing a proper/simpler reconstruction of some nodes.#1renecannao wants to merge 12 commits intomainfrom
renecannao wants to merge 12 commits intomainfrom
Conversation
- Reworked and improved SET parsing grammar - Improved some expressions parsing - Delayed subquery exprs parsing (out-of-scope). The delayed subquery parsing allows for proper SET stmts parsing without incurring in grammar parsing errors from currently out-of-scope exprs.
- Enable warnings via '-Wcounterexamples' for conflict resolution - Enable debugging capabilities for 'mysql_stdin_parser_example.cpp'
- Added query-set covering all the flows from MySQL SET stmt grammar. - Added payload processing based on 'set_testing-240' queries.
This work-in-progress, it doesn't work yet for all the presented tests cases. The current work reveals that changes are required in the AST itself for performing a proper/simpler reconstruction of some nodes.
* Scope qualifiers (GLOBAL/SESSION/PERSIST/PERSIST_ONLY) were lost * Function NOW() was incorrectly reconstructed
Improvements on SET parser
- Enable location tracking on parser for value extraction on SET statements. This allows for conditional parsing of sub-expressions like SELECT, overcoming any current grammar limitations and removing the necessity of query reconstruction from AST for value tracking. - Minimal naming convention fixes, several expressions parsing and added new tokens to lexer.
Add a test comparing the legacy REGEX-based SET parser and the new Bison impl using a wide sample of cases, including previous TAP tests for SET parsing.
- Refactor tests utilities into common files. The refactor takes into account later code reuse when integrating the work in ProxySQL. - Added new performance test, with three different checking modes. Parsing mode, compares parsing and value extraction, Matching mode compares the overhead of regex matching vs AST usage for query identification and validation. Matching offers a submode which doesn't take into account parsing, and just measures the differences between the two matching methodologies. - Added multiple optimizations over the utilities as a result of measurements taken during the creation of the performance test.
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.
No description provided.