diff options
author | Michael Meskes <meskes@postgresql.org> | 2017-08-14 11:29:34 +0200 |
---|---|---|
committer | Michael Meskes <meskes@postgresql.org> | 2017-08-16 13:29:00 +0200 |
commit | bd502753af5d4cc7be58a8e3fea6bc55d1e7b3a5 (patch) | |
tree | 799401827326bd2ebec0f6bea096a07726a2e5fd /src | |
parent | 76447fe3244142724b4b651bf6824989c6a16379 (diff) | |
download | postgresql-bd502753af5d4cc7be58a8e3fea6bc55d1e7b3a5.tar.gz postgresql-bd502753af5d4cc7be58a8e3fea6bc55d1e7b3a5.zip |
Changed ecpg parser to allow RETURNING clauses without attached C variables.
Diffstat (limited to 'src')
-rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.trailer | 7 | ||||
-rw-r--r-- | src/interfaces/ecpg/preproc/ecpg.type | 1 | ||||
-rw-r--r-- | src/interfaces/ecpg/preproc/parse.pl | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/interfaces/ecpg/preproc/ecpg.trailer b/src/interfaces/ecpg/preproc/ecpg.trailer index fb96d2ba894..ebd4af1685f 100644 --- a/src/interfaces/ecpg/preproc/ecpg.trailer +++ b/src/interfaces/ecpg/preproc/ecpg.trailer @@ -1878,9 +1878,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; } ; @@ -1888,6 +1887,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 ac6aa000ac2..9497b91b9db 100644 --- a/src/interfaces/ecpg/preproc/ecpg.type +++ b/src/interfaces/ecpg/preproc/ecpg.type @@ -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 diff --git a/src/interfaces/ecpg/preproc/parse.pl b/src/interfaces/ecpg/preproc/parse.pl index f76e47f9b83..d33ab180d63 100644 --- a/src/interfaces/ecpg/preproc/parse.pl +++ b/src/interfaces/ecpg/preproc/parse.pl @@ -95,7 +95,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' |