[tarantool-patches] Re: [PATCH v1 1/1] sql: do not replace the error with a syntax error
n.pettik
korablev at tarantool.org
Wed May 15 22:28:54 MSK 2019
> diff --git a/extra/lempar.c b/extra/lempar.c
> index d043e39..595f89e 100644
> --- a/extra/lempar.c
> +++ b/extra/lempar.c
> @@ -935,7 +935,8 @@ void Parse(
> yymajor = YYNOCODE;
> #endif
> }
> - }while( yymajor!=YYNOCODE && yypParser->yytos>yypParser->yystack );
> + }while( yymajor!=YYNOCODE && yypParser->yytos>yypParser->yystack
> + PARSER_ERROR_CHECK);
> #ifndef NDEBUG
> if( yyTraceFILE ){
> yyStackEntry *i;
> diff --git a/src/box/sql/parse.y b/src/box/sql/parse.y
> index 3a443a0..f241b8d 100644
> --- a/src/box/sql/parse.y
> +++ b/src/box/sql/parse.y
> @@ -80,6 +80,13 @@
> #define YYMALLOCARGTYPE u64
>
> /*
> + * Stop the parser if an error occurs. This macro adds an
> + * additional check that allows the parser to be stopped if any
> + * error was noticed.
> + */
> +#define PARSER_ERROR_CHECK && ! pParse->is_aborted
Any arguments in favour of using macro in this case?
Why don’t simply inline this condition?
The rest is OK as obvious.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.tarantool.org/pipermail/tarantool-patches/attachments/20190515/8bf7a68d/attachment.html>
More information about the Tarantool-patches
mailing list