← Back to team overview

maria-developers team mailing list archive

Re: Please review a simple patch changing shift/reduce conflicts from 160 to 121

 

Hi, Alexander!

On Nov 21, Alexander Barkov wrote:

> diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
> index bd2adc3..18980b3 100644
> --- a/sql/sql_yacc.yy
> +++ b/sql/sql_yacc.yy
> @@ -2062,10 +2063,18 @@ opt_end_of_input:
>          | END_OF_INPUT
>          ;
>  
> +/*
> +  binlog_base64_event is inside "verb_clause" rather than "statement".
> +  This makes it impossible to use in a stored routine.
> +  If we ever want to use it in SP, it should me moved from "verb_clause"
> +  to "statement", and BINLOG_SYM should be removed from "keyword_sp".
> +  Note, this will make impossible to use "BINLOG" as an SP label though.
> +*/

No, I think this is a hack. BINLOG should be in keyword_sp. The comment
there is quite clear:

  /*
   * Keywords that we allow for labels in SPs.
   * Anything that's the beginning of a statement or characteristics
   * must be in keyword above, otherwise we get (harmful) shift/reduce
   * conflicts.
   */
  keyword_sp:

and BINLOG most certainly can be "the beginning of a statement".

>  verb_clause:
>            statement
>          | begin
>          | compound_statement
> +        | binlog_base64_event
>          ;

Otherwise all ok! Looks great, thanks!

Regards,
Sergei


References