Repository navigation
Commit 884ae3a
committed
Port the query translation layer to the new MySQL AST
Re-key the SQL-to-SQLite translation from the old hand-written grammar
to the sql_yacc.yy rule names and tree shapes:
- Rewrite the translate() special cases and per-statement handlers
(SELECT, INSERT/REPLACE, UPDATE, DELETE, DDL, SHOW, SET, USE,
transactions and locking, administration statements).
- Iterate grammar lists with the flattened child node accessor, as
lists are left-recursive in the new grammar.
- Walk JOINs recursively when building the table reference map, as
joins nest through the left operand in the new grammar.
- Retry parsing with the ANSI_QUOTES SQL mode when a query fails to
parse. MySQL rejects double-quoted identifiers without ANSI_QUOTES,
but WordPress relies on them (dbDelta can produce double-quoted index
names) and the previous parser accepted them.1 parent 5eaef7a commit 884ae3a
2 files changed
Lines changed: 678 additions & 529 deletions
File tree
- packages/mysql-on-sqlite
- src/sqlite
- tests
0 commit comments