Skip to content

Commit f8bc6b2

Browse files
author
Michael Meskes
committed
Changed ecpg parser to allow RETURNING clauses without attached C variables.
1 parent 9f0f4ef commit f8bc6b2

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/interfaces/ecpg/preproc/ecpg.trailer

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1873,16 +1873,19 @@ Iresult: Iconst { $$ = $1; }
18731873
;
18741874

18751875
execute_rest: /* EMPTY */ { $$ = EMPTY; }
1876-
| ecpg_using ecpg_into { $$ = EMPTY; }
1876+
| ecpg_using opt_ecpg_into { $$ = EMPTY; }
18771877
| ecpg_into ecpg_using { $$ = EMPTY; }
1878-
| ecpg_using { $$ = EMPTY; }
18791878
| ecpg_into { $$ = EMPTY; }
18801879
;
18811880

18821881
ecpg_into: INTO into_list { $$ = EMPTY; }
18831882
| into_descriptor { $$ = $1; }
18841883
;
18851884

1885+
opt_ecpg_into: /* EMPTY */ { $$ = EMPTY; }
1886+
| ecpg_into { $$ = $1; }
1887+
;
1888+
18861889
ecpg_fetch_into: ecpg_into { $$ = $1; }
18871890
| using_descriptor
18881891
{

src/interfaces/ecpg/preproc/ecpg.type

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
%type <str> opt_bit_field
7979
%type <str> opt_connection_name
8080
%type <str> opt_database_name
81+
%type <str> opt_ecpg_into
8182
%type <str> opt_ecpg_fetch_into
8283
%type <str> opt_ecpg_using
8384
%type <str> opt_initializer

src/interfaces/ecpg/preproc/parse.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
'VariableShowStmtSHOWSESSIONAUTHORIZATION' =>
9595
'SHOW SESSION AUTHORIZATION ecpg_into',
9696
'returning_clauseRETURNINGtarget_list' =>
97-
'RETURNING target_list ecpg_into',
97+
'RETURNING target_list opt_ecpg_into',
9898
'ExecuteStmtEXECUTEnameexecute_param_clause' =>
9999
'EXECUTE prepared_name execute_param_clause execute_rest',
100100
'ExecuteStmtCREATEOptTempTABLEcreate_as_targetASEXECUTEnameexecute_param_clause'

0 commit comments

Comments
 (0)