]> granicus.if.org Git - postgresql/commitdiff
Changed ecpg parser to allow RETURNING clauses without attached C variables.
authorMichael Meskes <meskes@postgresql.org>
Mon, 14 Aug 2017 09:29:34 +0000 (11:29 +0200)
committerMichael Meskes <meskes@postgresql.org>
Mon, 14 Aug 2017 09:29:34 +0000 (11:29 +0200)
src/interfaces/ecpg/preproc/ecpg.trailer
src/interfaces/ecpg/preproc/ecpg.type
src/interfaces/ecpg/preproc/parse.pl

index 1c108795de995cbc4f801d9fa03267e210c4aa6d..d273070dabff24ca28f4fc77b9a10a2ad25df0ed 100644 (file)
@@ -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
        {
index ac6aa000ac2d65f04dceb0bd56c90b9827a80a7e..9497b91b9db9380ddd03dc4c9c8b7cb4778530d4 100644 (file)
@@ -78,6 +78,7 @@
 %type <str> opt_bit_field
 %type <str> opt_connection_name
 %type <str> opt_database_name
+%type <str> opt_ecpg_into
 %type <str> opt_ecpg_fetch_into
 %type <str> opt_ecpg_using
 %type <str> opt_initializer
index 8a401304ec5ccb0da3baeed852f6a2b461823949..768df3a6b1c1cb1db31a1c4f410f7b8feccaa65a 100644 (file)
@@ -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'