Skip to content

Commit cb6f5b0

Browse files
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 648a7e5 commit cb6f5b0

2 files changed

Lines changed: 678 additions & 529 deletions

File tree

0 commit comments

Comments
 (0)