Skip to content

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

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

renecannao
Copy link
Collaborator

No description provided.

JavierJF and others added 12 commits May 30, 2025 20:56
- 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
- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants