WL#6707: Umbrella: Refactor MySQL server parser to build the AST in a natural "bottom-up" way
Affects: Parser-Prototype Only — Status: In-Design — Priority: Medium
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
Copyright (c) 2000, 2017, Oracle Corporation and/or its affiliates. All rights reserved.