• Dmitry Shulga's avatar
    MDEV-5816: Stored programs: validation of stored program statements · 5ebff759
    Dmitry Shulga authored
    For those SP instructions that need to get access to LEX object on execution,
    added storing of their original sql expressions inside classes derived
    from the class sp_lex_instr.
    
    Stored sql expression is returned by the abstract method
      sp_lex_instr::get_expr_query
    redefined in derived classes.
    
    Since an expression constituting a SP instruction could be non valid
    SQL statement in general case (not parseable statement), the virtual method
    sp_lex_instr::get_query() has been introduced to return a valid string
    for a statement that corresponds to the given instruction.
    
    Additionally, introduced the rule remember_start_opt in the grammar.
    The new rule intended to get correct position of a current
    token taking into attention the fact whether lookahead was done or not.
    5ebff759
sql_lex.cc 348 KB