WL#6707: Umbrella: Refactor MySQL server parser to build the AST in a natural "bottom-up" way
Affects: Parser-Prototype Only
—
Status: In-Design
MySQL Server uses a Bison-generated parser to process the input SQL language. Bison is a LALR(1) parser generator that makes bottom-up parsers. However, by some historical reasons our parser grammar is designed to process the input language is the unnatural top-down way. This makes the grammar ambiguous (huge number of conflicts) and overcomplicated by empty and duplicated rules. Semantic actions depend on many states and hard to maintain. The parser grammar is complex to extend, parser bugs are hard to fix. The suggestion of this WL is a transformation of the the current parser into the pure stateless bottom-up parser step by step. The resulting parser will output a self-contained parse tree that has a minimal dependency on the rest of the Server. Current data flow: SQL input -> lex. scanner -> parser -> AST (SELECT_LEX, Items etc) -> executor After this WL: SQL input -> lex. scanner -> parser -> parse tree -> AST -> executor
WL#7201: True bottom-up server parser: refactoring of the INSERT/REPLACE statement
WL#7202: True bottom-up server parser: refactoring of the DELETE and TRUNCATE statements
WL#7203: True bottom-up server parser: refactoring of the SET statement
WL#8062: True bottom-up server parser: refactoring of the UPDATE statement
WL#8063: True bottom-up server parser: refactoring of the LOAD statement
WL#8065: True bottom-up server parser: refactoring of the EXPLAIN statement
WL#8066: True bottom-up server parser: refactoring of the HANDLER statement
WL#8067: True bottom-up server parser: refactoring of the CREATE TABLE statement
WL#8657: True bottom-up server parser: refactoring of the ALTER TABLE statement
WL#7202: True bottom-up server parser: refactoring of the DELETE and TRUNCATE statements
WL#7203: True bottom-up server parser: refactoring of the SET statement
WL#8062: True bottom-up server parser: refactoring of the UPDATE statement
WL#8063: True bottom-up server parser: refactoring of the LOAD statement
WL#8065: True bottom-up server parser: refactoring of the EXPLAIN statement
WL#8066: True bottom-up server parser: refactoring of the HANDLER statement
WL#8067: True bottom-up server parser: refactoring of the CREATE TABLE statement
WL#8657: True bottom-up server parser: refactoring of the ALTER TABLE statement
Copyright (c) 2000, 2024, Oracle Corporation and/or its affiliates. All rights reserved.