Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit51aacec

Browse files
author
Michael Meskes
committed
Synced parser
1 parent00306ef commit51aacec

File tree

2 files changed

+38
-36
lines changed

2 files changed

+38
-36
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,6 +1869,10 @@ Tue Oct 5 12:45:48 CEST 2004
18691869

18701870
- '::' is no longer interpreted as a variable in a prepare statement.
18711871
Added patch by Daniel Verite to fix this.
1872+
1873+
Mon Oct 18 15:34:51 CEST 2004
1874+
1875+
- Synced parser.
18721876
- Set ecpg version to 3.2.0.
18731877
- Set compat library version to 1.2.
18741878
- Set ecpg library version to 4.2.

‎src/interfaces/ecpg/preproc/preproc.y

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.297 2004/09/27 09:59:17 meskes Exp $*/
1+
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.298 2004/10/18 13:36:23 meskes Exp $*/
22

33
/* Copyright comment*/
44
%{
@@ -545,7 +545,7 @@ add_additional_variables(char *name, bool insert)
545545
%type<str>storage_declarationstorage_clauseopt_initializerc_anything
546546
%type<str>variable_listvariablec_thingc_termECPGKeywords_vanames
547547
%type<str>opt_pointerECPGDisconnectdis_namestorage_modifier
548-
%type<str>execstringserver_nameECPGVarDeclaration
548+
%type<str>execstringserver_nameECPGVarDeclarationfunc_expr
549549
%type<str>connection_objectopt_serveropt_portc_stuffc_stuff_item
550550
%type<str>user_nameopt_userchar_variableora_useridentopt_reference
551551
%type<str>var_type_declarationsquoted_ident_stringvarECPGKeywords_rest
@@ -2210,8 +2210,8 @@ index_params: index_elem{ $$ = $1; }
22102210

22112211
index_elem:ColIdopt_class
22122212
{$$ = cat2_str($1,$2); }
2213-
|func_name'('expr_list')'opt_class
2214-
{$$ =cat_str(5,$1,make_str("("),$3,")",$5); }
2213+
|func_expropt_class
2214+
{$$ =cat2_str($1,$2); }
22152215
|'('a_expr')'opt_class
22162216
{$$ = cat_str(4, make_str("("),$2, make_str(")"),$4); }
22172217
;
@@ -3291,10 +3291,7 @@ relation_expr:qualified_name
32913291
{/* inheritance query*/$$ = cat_str(3, make_str("only ("),$3, make_str(")")); }
32923292
;
32933293

3294-
func_table:func_name'('')'
3295-
{$$ = cat2_str($1, make_str("()")); }
3296-
|func_name'('expr_list')'
3297-
{$$ = cat_str(4,$1, make_str("("),$3, make_str(")")); }
3294+
func_table:func_expr {$$ =$1; }
32983295
;
32993296

33003297
where_clause:WHEREa_expr{$$ = cat2_str(make_str("where"),$2); }
@@ -3769,7 +3766,29 @@ c_expr: columnref
37693766
{$$ = cat_str(4, make_str("("),$2, make_str(")"),$4); }
37703767
|case_expr
37713768
{$$ =$1; }
3772-
|func_name'('')'
3769+
|func_expr
3770+
{$$ =$1; }
3771+
|select_with_parens%precUMINUS
3772+
{$$ =$1; }
3773+
|EXISTSselect_with_parens
3774+
{$$ = cat2_str(make_str("exists"),$2); }
3775+
|ARRAYselect_with_parens
3776+
{$$ = cat2_str(make_str("array"),$2); }
3777+
|ARRAYarray_expr
3778+
{$$ = cat2_str(make_str("array"),$2); }
3779+
|row
3780+
{$$ =$1; }
3781+
;
3782+
3783+
/*
3784+
* func_expr is split out from c_expr just so that we have a classification
3785+
* for "everything that is a function call or looks like one". This isn't
3786+
* very important, but it saves us having to document which variants are
3787+
* legal in the backwards-compatible functional-index syntax for CREATE INDEX.
3788+
* (Note that many of the special SQL functions wouldn't actually make any
3789+
* sense as functional index entries, but we ignore that consideration here.)
3790+
*/
3791+
func_expr:func_name'('')'
37733792
{$$ = cat2_str($1, make_str("()"));}
37743793
|func_name'('expr_list')'
37753794
{$$ = cat_str(4,$1, make_str("("),$3, make_str(")"));}
@@ -3820,18 +3839,13 @@ c_expr: columnref
38203839
{$$ = cat_str(5, make_str("convert("),$3, make_str("using"),$5, make_str(")"));}
38213840
|CONVERT'('expr_list')'
38223841
{$$ = cat_str(3, make_str("convert("),$3, make_str(")")); }
3823-
|select_with_parens%precUMINUS
3824-
{$$ =$1; }
3825-
|EXISTSselect_with_parens
3826-
{$$ = cat2_str(make_str("exists"),$2); }
3827-
|ARRAYselect_with_parens
3828-
{$$ = cat2_str(make_str("array"),$2); }
3829-
|ARRAYarray_expr
3830-
{$$ = cat2_str(make_str("array"),$2); }
3831-
|row
3832-
{$$ =$1; }
3842+
|NULLIF'('a_expr','a_expr')'
3843+
{$$ = cat_str(5, make_str("nullif("),$3, make_str(","),$5, make_str(")")); }
3844+
|COALESCE'('expr_list')'
3845+
{$$ = cat_str(3, make_str("coalesce("),$3, make_str(")")); }
38333846
;
38343847

3848+
38353849
row:ROW'('expr_list')'
38363850
{$$ = cat_str(3, make_str("row ("),$3, make_str(")")); }
38373851
|ROW'('')'
@@ -3972,25 +3986,9 @@ in_expr: select_with_parens
39723986

39733987
/* Case clause
39743988
* Define SQL92-style case clause.
3975-
* Allow all four forms described in the standard:
3976-
* - Full specification
3977-
*CASE WHEN a = b THEN c ... ELSE d END
3978-
* - Implicit argument
3979-
*CASE a WHEN b THEN c ... ELSE d END
3980-
* - Conditional NULL
3981-
*NULLIF(x,y)
3982-
*same as CASE WHEN x = y THEN NULL ELSE x END
3983-
* - Conditional substitution from list, use first non-null argument
3984-
*COALESCE(a,b,...)
3985-
* same as CASE WHEN a IS NOT NULL THEN a WHEN b IS NOT NULL THEN b ... END
3986-
* - thomas 1998-11-09
39873989
*/
39883990
case_expr:CASEcase_argwhen_clause_listcase_defaultEND_P
39893991
{$$ = cat_str(5, make_str("case"),$2,$3,$4, make_str("end")); }
3990-
|NULLIF'('a_expr','a_expr')'
3991-
{$$ = cat_str(5, make_str("nullif("),$3, make_str(","),$5, make_str(")")); }
3992-
|COALESCE'('expr_list')'
3993-
{$$ = cat_str(3, make_str("coalesce("),$3, make_str(")")); }
39943992
;
39953993

39963994
when_clause_list:when_clause_listwhen_clause
@@ -5981,6 +5979,7 @@ ECPGunreserved: ABORT_P{ $$ = make_str("abort"); }
59815979
|NOCREATEUSER{$$ = make_str("nocreateuser"); }
59825980
|NOTHING{$$ = make_str("nothing"); }
59835981
|NOTIFY{$$ = make_str("notify"); }
5982+
|NOWAIT{$$ = make_str("nowait"); }
59845983
|OBJECT_P{$$ = make_str("object"); }
59855984
|OF{$$ = make_str("of"); }
59865985
|OIDS{$$ = make_str("oids"); }
@@ -6196,7 +6195,6 @@ reserved_keyword:
61966195
|LIMIT{$$ = make_str("limit"); }
61976196
|NEW{$$ = make_str("new"); }
61986197
|NOT{$$ = make_str("not"); }
6199-
|NOWAIT{$$ = make_str("nowait"); }
62006198
|NULL_P{$$ = make_str("null"); }
62016199
|OFF{$$ = make_str("off"); }
62026200
|OFFSET{$$ = make_str("offset"); }

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp