Skip to content

Commit ef48ed4

Browse files
committed
Actually ... it's pretty silly that parse_oper.c doesn't set up the
opfuncid of an OpExpr initially, considering that it has the information at hand already. We'll still treat opfuncid as a cache rather than a guaranteed-valid value, but this change saves one more syscache lookup in the normal code path.
1 parent 6342f36 commit ef48ed4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/backend/parser/parse_oper.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/parser/parse_oper.c,v 1.97 2007/11/15 21:14:37 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/parser/parse_oper.c,v 1.98 2007/11/22 19:40:25 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -939,7 +939,7 @@ make_scalar_array_op(ParseState *pstate, List *opname,
939939
/* and build the expression node */
940940
result = makeNode(ScalarArrayOpExpr);
941941
result->opno = oprid(tup);
942-
result->opfuncid = InvalidOid;
942+
result->opfuncid = opform->oprcode;
943943
result->useOr = useOr;
944944
result->args = args;
945945

@@ -1011,7 +1011,7 @@ make_op_expr(ParseState *pstate, Operator op,
10111011
/* and build the expression node */
10121012
result = makeNode(OpExpr);
10131013
result->opno = oprid(op);
1014-
result->opfuncid = InvalidOid;
1014+
result->opfuncid = opform->oprcode;
10151015
result->opresulttype = rettype;
10161016
result->opretset = get_func_retset(opform->oprcode);
10171017
result->args = args;

src/include/nodes/primnodes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
1111
* Portions Copyright (c) 1994, Regents of the University of California
1212
*
13-
* $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.135 2007/11/15 22:25:17 momjian Exp $
13+
* $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.136 2007/11/22 19:40:25 tgl Exp $
1414
*
1515
*-------------------------------------------------------------------------
1616
*/
@@ -302,7 +302,7 @@ typedef struct FuncExpr
302302
*
303303
* Note that opfuncid is not necessarily filled in immediately on creation
304304
* of the node. The planner makes sure it is valid before passing the node
305-
* tree to the executor, but during parsing/planning opfuncid is typically 0.
305+
* tree to the executor, but during parsing/planning opfuncid can be 0.
306306
*/
307307
typedef struct OpExpr
308308
{

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