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

Commita65e448

Browse files
committed
Fix for aggs on views and complex ones. I missed one file.
1 parent4b05912 commita65e448

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

‎src/backend/parser/parse_expr.c

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.4 1997/12/23 19:36:20 thomas Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.5 1998/01/04 04:53:50 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -55,7 +55,8 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
5555
Node*temp;
5656

5757
/* what if att.attrs == "*"?? */
58-
temp=handleNestedDots(pstate,att,&pstate->p_last_resno);
58+
temp=handleNestedDots(pstate,att,&pstate->p_last_resno,
59+
precedence);
5960
if (att->indirection!=NIL)
6061
{
6162
List*idx=att->indirection;
@@ -156,7 +157,8 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
156157

157158
result=ParseFunc(pstate,
158159
"nullvalue",lcons(lexpr,NIL),
159-
&pstate->p_last_resno);
160+
&pstate->p_last_resno,
161+
precedence);
160162
}
161163
break;
162164
caseNOTNULL:
@@ -165,7 +167,8 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
165167

166168
result=ParseFunc(pstate,
167169
"nonnullvalue",lcons(lexpr,NIL),
168-
&pstate->p_last_resno);
170+
&pstate->p_last_resno,
171+
precedence);
169172
}
170173
break;
171174
caseAND:
@@ -242,7 +245,8 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
242245
foreach(args,fn->args)
243246
lfirst(args)=transformExpr(pstate, (Node*)lfirst(args),precedence);
244247
result=ParseFunc(pstate,
245-
fn->funcname,fn->args,&pstate->p_last_resno);
248+
fn->funcname,fn->args,&pstate->p_last_resno,
249+
precedence);
246250
break;
247251
}
248252
default:
@@ -273,7 +277,8 @@ transformIdent(ParseState *pstate, Node *expr, int precedence)
273277
att->relname=rte->refname;
274278
att->attrs=lcons(makeString(ident->name),NIL);
275279
column_result=
276-
(Node*)handleNestedDots(pstate,att,&pstate->p_last_resno);
280+
(Node*)handleNestedDots(pstate,att,&pstate->p_last_resno,
281+
precedence);
277282
}
278283

279284
/* try to find the ident as a relation */
@@ -358,7 +363,7 @@ exprType(Node *expr)
358363
** a tree with of Iter and Func nodes.
359364
*/
360365
Node*
361-
handleNestedDots(ParseState*pstate,Attr*attr,int*curr_resno)
366+
handleNestedDots(ParseState*pstate,Attr*attr,int*curr_resno,intprecedence)
362367
{
363368
List*mutator_iter;
364369
Node*retval=NULL;
@@ -370,7 +375,8 @@ handleNestedDots(ParseState *pstate, Attr *attr, int *curr_resno)
370375
retval=
371376
ParseFunc(pstate,strVal(lfirst(attr->attrs)),
372377
lcons(param,NIL),
373-
curr_resno);
378+
curr_resno,
379+
precedence);
374380
}
375381
else
376382
{
@@ -381,14 +387,16 @@ handleNestedDots(ParseState *pstate, Attr *attr, int *curr_resno)
381387
retval=
382388
ParseFunc(pstate,strVal(lfirst(attr->attrs)),
383389
lcons(ident,NIL),
384-
curr_resno);
390+
curr_resno,
391+
precedence);
385392
}
386393

387394
foreach(mutator_iter,lnext(attr->attrs))
388395
{
389396
retval=ParseFunc(pstate,strVal(lfirst(mutator_iter)),
390397
lcons(retval,NIL),
391-
curr_resno);
398+
curr_resno,
399+
precedence);
392400
}
393401

394402
return (retval);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp