Skip to content

Commit 0ba9b56

Browse files
author
Michael Meskes
committed
Synced parser.
1 parent c91ff03 commit 0ba9b56

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2370,6 +2370,10 @@ Tue, 24 Jun 2008 13:30:51 +0200
23702370
Tue, 19 Aug 2008 12:32:24 +0200
23712371

23722372
- Fixed incorrect argument handling in SET command if argument is a variable.
2373+
2374+
Wed, 20 Aug 2008 15:49:23 +0200
2375+
2376+
- Synced parser.
23732377
- Set pgtypes library version to 3.1.
23742378
- Set compat library version to 3.1.
23752379
- Set ecpg library version to 6.2.

src/interfaces/ecpg/preproc/preproc.y

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.370 2008/08/19 10:40:32 meskes Exp $ */
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.371 2008/08/20 14:09:16 meskes Exp $ */
22

33
/* Copyright comment */
44
%{
@@ -564,7 +564,7 @@ add_typedef(char *name, char * dimension, char * length, enum ECPGttype type_enu
564564
%type <str> Typename SimpleTypename Numeric opt_float DiscardStmt
565565
%type <str> Character character opt_varying opt_charset enum_val_list
566566
%type <str> opt_timezone opt_interval table_ref fetch_direction
567-
%type <str> ConstDatetime AlterDomainStmt AlterSeqStmt
567+
%type <str> ConstDatetime AlterDomainStmt AlterSeqStmt table_func_column
568568
%type <str> SelectStmt into_clause OptTemp ConstraintAttributeSpec
569569
%type <str> opt_table opt_all sort_clause sortby_list ConstraintAttr
570570
%type <str> sortby qualified_name_list name_list ColId_or_Sconst
@@ -590,7 +590,7 @@ add_typedef(char *name, char * dimension, char * length, enum ECPGttype type_enu
590590
%type <str> RemoveOperStmt RenameStmt all_Op opt_trusted opt_lancompiler
591591
%type <str> VariableSetStmt var_value zone_value VariableShowStmt
592592
%type <str> VariableResetStmt AlterTableStmt from_list overlay_list
593-
%type <str> relation_name OptTableSpace LockStmt opt_lock
593+
%type <str> relation_name OptTableSpace LockStmt opt_lock table_func_column_list
594594
%type <str> CreateUserStmt AlterUserStmt CreateSeqStmt SeqOptList
595595
%type <str> SeqOptElem TriggerForSpec TriggerForOpt TriggerForType
596596
%type <str> DropTrigStmt TriggerOneEvent TriggerEvents RuleActionStmt
@@ -2379,7 +2379,7 @@ fetch_direction: NEXT { $$ = make_str("next"); }
23792379
fetch_count: IntConst {
23802380
if ($1[1] == '$')
23812381
{
2382-
/* a variable here has to be replaced on the client side, thus we have to use '?' here */
2382+
/* a variable here has to be replaced on the client side, thus we have to use '$0' here */
23832383
$$ = make_str("$0");
23842384
free($1);
23852385
}
@@ -2606,6 +2606,9 @@ opt_nulls_order: NULLS_FIRST { $$ = make_str("nulls first"); }
26062606
CreateFunctionStmt: CREATE opt_or_replace FUNCTION func_name func_args
26072607
RETURNS func_return createfunc_opt_list opt_definition
26082608
{ $$ = cat_str(8, make_str("create"), $2, make_str("function"), $4, $5, make_str("returns"), $7, $8); }
2609+
| CREATE opt_or_replace FUNCTION func_name func_args
2610+
RETURNS TABLE '(' table_func_column_list ')' createfunc_opt_list opt_definition
2611+
{ $$ = cat_str(9, make_str("create"), $2, make_str("function"), $4, $5, make_str("returns table ("), $9, make_str(")"), $11, $12); }
26092612
| CREATE opt_or_replace FUNCTION func_name func_args
26102613
createfunc_opt_list opt_definition
26112614
{ $$ = cat_str(6, make_str("create"), $2, make_str("function"), $4, $5, $6, $7); }
@@ -2715,6 +2718,14 @@ opt_definition: WITH definition { $$ = cat2_str(make_str("with"), $2); }
27152718
| /*EMPTY*/ { $$ = EMPTY; }
27162719
;
27172720

2721+
table_func_column: param_name func_type { $$ = cat2_str($1, $2); }
2722+
;
2723+
2724+
table_func_column_list:
2725+
table_func_column { $$ = $1; }
2726+
| table_func_column_list ',' table_func_column { $$ = cat_str(3, $1, make_str(","), $3); }
2727+
;
2728+
27182729
AlterFunctionStmt:
27192730
ALTER FUNCTION function_with_argtypes alterfunc_opt_list opt_restrict
27202731
{ $$ = cat_str(4, make_str("alter function"), $3, $4, $5); }
@@ -4383,6 +4394,10 @@ func_expr: func_name '(' ')'
43834394
{ $$ = cat2_str($1, make_str("()")); }
43844395
| func_name '(' expr_list ')'
43854396
{ $$ = cat_str(4, $1, make_str("("), $3, make_str(")")); }
4397+
| func_name '(' VARIADIC a_expr ')'
4398+
{ $$ = cat_str(4, $1, make_str("( variadic "), $4, make_str(")")); }
4399+
| func_name '(' expr_list ',' VARIADIC a_expr ')'
4400+
{ $$ = cat_str(6, $1, make_str("("), $3, make_str(", variadic "), $6, make_str(")")); }
43864401
| func_name '(' ALL expr_list ')'
43874402
{ $$ = cat_str(4, $1, make_str("( all"), $4, make_str(")")); }
43884403
| func_name '(' DISTINCT expr_list ')'

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy