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

Commit77ebed0

Browse files
committed
Add Aggref and ArrayRef to the set of node types that transformExpr
will pass through rather than spitting up. This is necessary to handlecases where coerce_type causes a subexpression to be retransformed, as inSELECT count(*) + 1.0 FROM table
1 parent2d7ec47 commit77ebed0

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

‎src/backend/parser/parse_expr.c

Lines changed: 13 additions & 7 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.45 1999/05/13 07:28:38 tgl Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.46 1999/05/18 23:40:05 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -478,17 +478,23 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
478478
* At least one construct (BETWEEN/AND) puts the same nodes
479479
*into two branches of the parse tree; hence, some nodes
480480
*are transformed twice.
481-
* The three cases below come from transforming function calls.
482-
* Let's try just passing them through...
483-
* - thomas 1998-03-14
481+
* Another way it can happen is that coercion of an operator or
482+
*function argument to the required type (via coerce_type())
483+
*can apply transformExpr to an already-transformed subexpression.
484+
*An example here is "SELECT count(*) + 1.0 FROM table".
485+
* Thus, we can see node types in this routine that do not appear in the
486+
*original parse tree. Assume they are already transformed, and just
487+
*pass them through.
488+
* Do any other node types need to be accepted? For now we are taking
489+
*a conservative approach, and only accepting node types that are
490+
*demonstrably necessary to accept.
484491
*/
485492
caseT_Expr:
486493
caseT_Var:
487494
caseT_Const:
488-
/* T_Param comes from implicit function calls in INSERT/VALUE statements.
489-
* - thomas 1998-06-11
490-
*/
491495
caseT_Param:
496+
caseT_Aggref:
497+
caseT_ArrayRef:
492498
{
493499
result= (Node*)expr;
494500
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp