From: Michael Meskes Date: Mon, 14 Aug 2017 09:29:34 +0000 (+0200) Subject: Changed ecpg parser to allow RETURNING clauses without attached C variables. X-Git-Tag: REL_10_BETA4~57 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ea0ca75d5d14e0c98782a2188405685af4a475a0;p=postgresql Changed ecpg parser to allow RETURNING clauses without attached C variables. --- diff --git a/src/interfaces/ecpg/preproc/ecpg.trailer b/src/interfaces/ecpg/preproc/ecpg.trailer index 1c108795de..d273070dab 100644 --- a/src/interfaces/ecpg/preproc/ecpg.trailer +++ b/src/interfaces/ecpg/preproc/ecpg.trailer @@ -1877,9 +1877,8 @@ Iresult: Iconst { $$ = $1; } ; execute_rest: /* EMPTY */ { $$ = EMPTY; } - | ecpg_using ecpg_into { $$ = EMPTY; } + | ecpg_using opt_ecpg_into { $$ = EMPTY; } | ecpg_into ecpg_using { $$ = EMPTY; } - | ecpg_using { $$ = EMPTY; } | ecpg_into { $$ = EMPTY; } ; @@ -1887,6 +1886,10 @@ ecpg_into: INTO into_list { $$ = EMPTY; } | into_descriptor { $$ = $1; } ; +opt_ecpg_into: /* EMPTY */ { $$ = EMPTY; } + | ecpg_into { $$ = $1; } + ; + ecpg_fetch_into: ecpg_into { $$ = $1; } | using_descriptor { diff --git a/src/interfaces/ecpg/preproc/ecpg.type b/src/interfaces/ecpg/preproc/ecpg.type index ac6aa000ac..9497b91b9d 100644 --- a/src/interfaces/ecpg/preproc/ecpg.type +++ b/src/interfaces/ecpg/preproc/ecpg.type @@ -78,6 +78,7 @@ %type opt_bit_field %type opt_connection_name %type opt_database_name +%type opt_ecpg_into %type opt_ecpg_fetch_into %type opt_ecpg_using %type opt_initializer diff --git a/src/interfaces/ecpg/preproc/parse.pl b/src/interfaces/ecpg/preproc/parse.pl index 8a401304ec..768df3a6b1 100644 --- a/src/interfaces/ecpg/preproc/parse.pl +++ b/src/interfaces/ecpg/preproc/parse.pl @@ -98,7 +98,7 @@ my %replace_line = ( 'VariableShowStmtSHOWSESSIONAUTHORIZATION' => 'SHOW SESSION AUTHORIZATION ecpg_into', 'returning_clauseRETURNINGtarget_list' => - 'RETURNING target_list ecpg_into', + 'RETURNING target_list opt_ecpg_into', 'ExecuteStmtEXECUTEnameexecute_param_clause' => 'EXECUTE prepared_name execute_param_clause execute_rest', 'ExecuteStmtCREATEOptTempTABLEcreate_as_targetASEXECUTEnameexecute_param_clause'