Age Owner Branch data TLA Line data Source code
1 : : /*-------------------------------------------------------------------------
2 : : *
3 : : * preptlist.c
4 : : * Routines to preprocess the parse tree target list
5 : : *
6 : : * For an INSERT, the targetlist must contain an entry for each attribute of
7 : : * the target relation in the correct order.
8 : : *
9 : : * For an UPDATE, the targetlist just contains the expressions for the new
10 : : * column values.
11 : : *
12 : : * For UPDATE and DELETE queries, the targetlist must also contain "junk"
13 : : * tlist entries needed to allow the executor to identify the rows to be
14 : : * updated or deleted; for example, the ctid of a heap row. (The planner
15 : : * adds these; they're not in what we receive from the parser/rewriter.)
16 : : *
17 : : * For all query types, there can be additional junk tlist entries, such as
18 : : * sort keys, Vars needed for a RETURNING list, and row ID information needed
19 : : * for SELECT FOR UPDATE locking and/or EvalPlanQual checking.
20 : : *
21 : : * The query rewrite phase also does preprocessing of the targetlist (see
22 : : * rewriteTargetListIU). The division of labor between here and there is
23 : : * partially historical, but it's not entirely arbitrary. The stuff done
24 : : * here is closely connected to physical access to tables, whereas the
25 : : * rewriter's work is more concerned with SQL semantics.
26 : : *
27 : : *
28 : : * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
29 : : * Portions Copyright (c) 1994, Regents of the University of California
30 : : *
31 : : * IDENTIFICATION
32 : : * src/backend/optimizer/prep/preptlist.c
33 : : *
34 : : *-------------------------------------------------------------------------
35 : : */
36 : :
37 : : #include "postgres.h"
38 : :
39 : : #include "access/sysattr.h"
40 : : #include "access/table.h"
41 : : #include "catalog/pg_type_d.h"
42 : : #include "nodes/makefuncs.h"
43 : : #include "optimizer/appendinfo.h"
44 : : #include "optimizer/optimizer.h"
45 : : #include "optimizer/prep.h"
46 : : #include "optimizer/tlist.h"
47 : : #include "parser/parse_coerce.h"
48 : : #include "parser/parsetree.h"
49 : : #include "utils/lsyscache.h"
50 : : #include "utils/rel.h"
51 : :
52 : : static List *expand_insert_targetlist(PlannerInfo *root, List *tlist,
53 : : Relation rel);
54 : :
55 : :
56 : : /*
57 : : * preprocess_targetlist
58 : : * Driver for preprocessing the parse tree targetlist.
59 : : *
60 : : * The preprocessed targetlist is returned in root->processed_tlist.
61 : : * Also, if this is an UPDATE, we return a list of target column numbers
62 : : * in root->update_colnos. (Resnos in processed_tlist will be consecutive,
63 : : * so do not look at that to find out which columns are targets!)
64 : : */
65 : : void
3081 tgl@sss.pgh.pa.us 66 :CBC 391258 : preprocess_targetlist(PlannerInfo *root)
67 : : {
7507 bruce@momjian.us 68 : 391258 : Query *parse = root->parse;
69 : 391258 : int result_relation = parse->resultRelation;
70 : 391258 : List *range_table = parse->rtable;
71 : 391258 : CmdType command_type = parse->commandType;
3081 tgl@sss.pgh.pa.us 72 : 391258 : RangeTblEntry *target_rte = NULL;
73 : 391258 : Relation target_relation = NULL;
74 : : List *tlist;
75 : : ListCell *lc;
76 : :
77 : : /*
78 : : * If there is a result relation, open it so we can look for missing
79 : : * columns and so on. We assume that previous code already acquired at
80 : : * least AccessShareLock on the relation, so we need no lock here.
81 : : */
9343 82 [ + + ]: 391258 : if (result_relation)
83 : : {
3081 84 : 60619 : target_rte = rt_fetch(result_relation, range_table);
85 : :
86 : : /*
87 : : * Sanity check: it'd better be a real relation not, say, a subquery.
88 : : * Else parser or rewriter messed up.
89 : : */
90 [ - + ]: 60619 : if (target_rte->rtekind != RTE_RELATION)
3081 tgl@sss.pgh.pa.us 91 [ # # ]:UBC 0 : elog(ERROR, "result relation must be a regular relation");
92 : :
2661 andres@anarazel.de 93 :CBC 60619 : target_relation = table_open(target_rte->relid, NoLock);
94 : : }
95 : : else
3081 tgl@sss.pgh.pa.us 96 [ - + ]: 330639 : Assert(command_type == CMD_SELECT);
97 : :
98 : : /*
99 : : * In an INSERT, the executor expects the targetlist to match the exact
100 : : * order of the target table's attributes, including entries for
101 : : * attributes not mentioned in the source query.
102 : : *
103 : : * In an UPDATE, we don't rearrange the tlist order, but we need to make a
104 : : * separate list of the target attribute numbers, in tlist order, and then
105 : : * renumber the processed_tlist entries to be consecutive.
106 : : */
107 : 391258 : tlist = parse->targetList;
1861 108 [ + + ]: 391258 : if (command_type == CMD_INSERT)
461 109 : 45026 : tlist = expand_insert_targetlist(root, tlist, target_relation);
1861 110 [ + + ]: 346232 : else if (command_type == CMD_UPDATE)
1821 111 : 10400 : root->update_colnos = extract_update_targetlist_colnos(tlist);
112 : :
113 : : /*
114 : : * For non-inherited UPDATE/DELETE/MERGE, register any junk column(s)
115 : : * needed to allow the executor to identify the rows to be updated or
116 : : * deleted. In the inheritance case, we do nothing now, leaving this to
117 : : * be dealt with when expand_inherited_rtentry() makes the leaf target
118 : : * relations. (But there might not be any leaf target relations, in which
119 : : * case we must do this in distribute_row_identity_vars().)
120 : : */
1484 alvherre@alvh.no-ip. 121 [ + + + + : 391258 : if ((command_type == CMD_UPDATE || command_type == CMD_DELETE ||
+ + ]
122 : 15593 : command_type == CMD_MERGE) &&
1861 tgl@sss.pgh.pa.us 123 [ + + ]: 15593 : !target_rte->inh)
124 : : {
125 : : /* row-identity logic expects to add stuff to processed_tlist */
126 : 13276 : root->processed_tlist = tlist;
127 : 13276 : add_row_identity_columns(root, result_relation,
128 : : target_rte, target_relation);
129 : 13276 : tlist = root->processed_tlist;
130 : : }
131 : :
132 : : /*
133 : : * For MERGE we also need to handle the target list for each INSERT and
134 : : * UPDATE action separately. In addition, we examine the qual of each
135 : : * action and add any Vars there (other than those of the target rel) to
136 : : * the subplan targetlist.
137 : : */
1499 alvherre@alvh.no-ip. 138 [ + + ]: 391258 : if (command_type == CMD_MERGE)
139 : : {
140 : : ListCell *l;
141 : : List *vars;
142 : :
143 : : /*
144 : : * For MERGE, handle targetlist of each MergeAction separately. Give
145 : : * the same treatment to MergeAction->targetList as we would have
146 : : * given to a regular INSERT. For UPDATE, collect the column numbers
147 : : * being modified.
148 : : */
149 [ + - + + : 3746 : foreach(l, parse->mergeActionList)
+ + ]
150 : : {
151 : 2266 : MergeAction *action = (MergeAction *) lfirst(l);
152 : : ListCell *l2;
153 : :
154 [ + + ]: 2266 : if (action->commandType == CMD_INSERT)
461 tgl@sss.pgh.pa.us 155 : 746 : action->targetList = expand_insert_targetlist(root,
156 : : action->targetList,
157 : : target_relation);
1499 alvherre@alvh.no-ip. 158 [ + + ]: 1520 : else if (action->commandType == CMD_UPDATE)
159 : 1067 : action->updateColnos =
160 : 1067 : extract_update_targetlist_colnos(action->targetList);
161 : :
162 : : /*
163 : : * Add resjunk entries for any Vars and PlaceHolderVars used in
164 : : * each action's targetlist and WHEN condition that belong to
165 : : * relations other than the target. We don't expect to see any
166 : : * aggregates or window functions here.
167 : : */
1484 168 : 2266 : vars = pull_var_clause((Node *)
169 : 2266 : list_concat_copy((List *) action->qual,
170 : 2266 : action->targetList),
171 : : PVC_INCLUDE_PLACEHOLDERS);
172 [ + + + + : 5065 : foreach(l2, vars)
+ + ]
173 : : {
174 : 2799 : Var *var = (Var *) lfirst(l2);
175 : : TargetEntry *tle;
176 : :
177 [ + + + + ]: 2799 : if (IsA(var, Var) && var->varno == result_relation)
178 : 1330 : continue; /* don't need it */
179 : :
180 [ + + ]: 1469 : if (tlist_member((Expr *) var, tlist))
181 : 389 : continue; /* already got it */
182 : :
183 : 1080 : tle = makeTargetEntry((Expr *) var,
184 : 1080 : list_length(tlist) + 1,
185 : : NULL, true);
186 : 1080 : tlist = lappend(tlist, tle);
187 : : }
188 : 2266 : list_free(vars);
189 : : }
190 : :
191 : : /*
192 : : * Add resjunk entries for any Vars and PlaceHolderVars used in the
193 : : * join condition that belong to relations other than the target. We
194 : : * don't expect to see any aggregates or window functions here.
195 : : */
766 dean.a.rasheed@gmail 196 : 1480 : vars = pull_var_clause(parse->mergeJoinCondition,
197 : : PVC_INCLUDE_PLACEHOLDERS);
198 [ + + + + : 1805 : foreach(l, vars)
+ + ]
199 : : {
200 : 325 : Var *var = (Var *) lfirst(l);
201 : : TargetEntry *tle;
202 : :
203 [ + + + + ]: 325 : if (IsA(var, Var) && var->varno == result_relation)
204 : 110 : continue; /* don't need it */
205 : :
206 [ + + ]: 215 : if (tlist_member((Expr *) var, tlist))
207 : 85 : continue; /* already got it */
208 : :
209 : 130 : tle = makeTargetEntry((Expr *) var,
210 : 130 : list_length(tlist) + 1,
211 : : NULL, true);
212 : 130 : tlist = lappend(tlist, tle);
213 : : }
214 : : }
215 : :
216 : : /*
217 : : * Add necessary junk columns for rowmarked rels. These values are needed
218 : : * for locking of rels selected FOR UPDATE/SHARE, and to do EvalPlanQual
219 : : * rechecking. See comments for PlanRowMark in plannodes.h. If you
220 : : * change this stanza, see also expand_inherited_rtentry(), which has to
221 : : * be able to add on junk columns equivalent to these.
222 : : *
223 : : * (Someday it might be useful to fold these resjunk columns into the
224 : : * row-identity-column management used for UPDATE/DELETE. Today is not
225 : : * that day, however. One notable issue is that it seems important that
226 : : * the whole-row Vars made here use the real table rowtype, not RECORD, so
227 : : * that conversion to/from child relations' rowtypes will happen. Also,
228 : : * since these entries don't potentially bloat with more and more child
229 : : * relations, there's not really much need for column sharing.)
230 : : */
6035 tgl@sss.pgh.pa.us 231 [ + + + + : 400204 : foreach(lc, root->rowMarks)
+ + ]
232 : : {
233 : 8946 : PlanRowMark *rc = (PlanRowMark *) lfirst(lc);
234 : : Var *var;
235 : : char resname[32];
236 : : TargetEntry *tle;
237 : :
238 : : /* child rels use the same junk attrs as their parents */
239 [ - + ]: 8946 : if (rc->rti != rc->prti)
6035 tgl@sss.pgh.pa.us 240 :UBC 0 : continue;
241 : :
4069 tgl@sss.pgh.pa.us 242 [ + + ]:CBC 8946 : if (rc->allMarkTypes & ~(1 << ROW_MARK_COPY))
243 : : {
244 : : /* Need to fetch TID */
7310 245 : 8407 : var = makeVar(rc->rti,
246 : : SelfItemPointerAttributeNumber,
247 : : TIDOID,
248 : : -1,
249 : : InvalidOid,
250 : : 0);
5564 251 : 8407 : snprintf(resname, sizeof(resname), "ctid%u", rc->rowmarkId);
7699 252 : 8407 : tle = makeTargetEntry((Expr *) var,
253 : 8407 : list_length(tlist) + 1,
254 : : pstrdup(resname),
255 : : true);
256 : 8407 : tlist = lappend(tlist, tle);
257 : : }
4069 258 [ + + ]: 8946 : if (rc->allMarkTypes & (1 << ROW_MARK_COPY))
259 : : {
260 : : /* Need the whole row as a junk var */
5677 261 : 539 : var = makeWholeRowVar(rt_fetch(rc->rti, range_table),
262 : 539 : rc->rti,
263 : : 0,
264 : : false);
5564 265 : 539 : snprintf(resname, sizeof(resname), "wholerow%u", rc->rowmarkId);
6035 266 : 539 : tle = makeTargetEntry((Expr *) var,
267 : 539 : list_length(tlist) + 1,
268 : : pstrdup(resname),
269 : : true);
270 : 539 : tlist = lappend(tlist, tle);
271 : : }
272 : :
273 : : /* If parent of inheritance tree, always fetch the tableoid too. */
4031 sfrost@snowman.net 274 [ - + ]: 8946 : if (rc->isParent)
275 : : {
4031 sfrost@snowman.net 276 :UBC 0 : var = makeVar(rc->rti,
277 : : TableOidAttributeNumber,
278 : : OIDOID,
279 : : -1,
280 : : InvalidOid,
281 : : 0);
282 : 0 : snprintf(resname, sizeof(resname), "tableoid%u", rc->rowmarkId);
283 : 0 : tle = makeTargetEntry((Expr *) var,
284 : 0 : list_length(tlist) + 1,
285 : : pstrdup(resname),
286 : : true);
287 : 0 : tlist = lappend(tlist, tle);
288 : : }
289 : : }
290 : :
291 : : /*
292 : : * If the query has a RETURNING list, add resjunk entries for any Vars
293 : : * used in RETURNING that belong to other relations. We need to do this
294 : : * to make these Vars available for the RETURNING calculation. Vars that
295 : : * belong to the result rel don't need to be added, because they will be
296 : : * made to refer to the actual heap tuple.
297 : : */
7206 tgl@sss.pgh.pa.us 298 [ + + + + ]:CBC 391258 : if (parse->returningList && list_length(parse->rtable) > 1)
299 : : {
300 : : List *vars;
301 : : ListCell *l;
302 : :
6225 303 : 1751 : vars = pull_var_clause((Node *) parse->returningList,
304 : : PVC_RECURSE_AGGREGATES |
305 : : PVC_RECURSE_WINDOWFUNCS |
306 : : PVC_INCLUDE_PLACEHOLDERS);
7206 307 [ + + + + : 7607 : foreach(l, vars)
+ + ]
308 : : {
309 : 5856 : Var *var = (Var *) lfirst(l);
310 : : TargetEntry *tle;
311 : :
6405 312 [ + - ]: 5856 : if (IsA(var, Var) &&
313 [ + + ]: 5856 : var->varno == result_relation)
7206 314 : 5344 : continue; /* don't need it */
315 : :
3344 peter_e@gmx.net 316 [ + + ]: 512 : if (tlist_member((Expr *) var, tlist))
7206 tgl@sss.pgh.pa.us 317 : 192 : continue; /* already got it */
318 : :
319 : 320 : tle = makeTargetEntry((Expr *) var,
320 : 320 : list_length(tlist) + 1,
321 : : NULL,
322 : : true);
323 : :
324 : 320 : tlist = lappend(tlist, tle);
325 : : }
326 : 1751 : list_free(vars);
327 : : }
328 : :
1861 329 : 391258 : root->processed_tlist = tlist;
330 : :
3081 331 [ + + ]: 391258 : if (target_relation)
2661 andres@anarazel.de 332 : 60619 : table_close(target_relation, NoLock);
1861 tgl@sss.pgh.pa.us 333 : 391258 : }
334 : :
335 : : /*
336 : : * extract_update_targetlist_colnos
337 : : * Extract a list of the target-table column numbers that
338 : : * an UPDATE's targetlist wants to assign to, then renumber.
339 : : *
340 : : * The convention in the parser and rewriter is that the resnos in an
341 : : * UPDATE's non-resjunk TLE entries are the target column numbers
342 : : * to assign to. Here, we extract that info into a separate list, and
343 : : * then convert the tlist to the sequential-numbering convention that's
344 : : * used by all other query types.
345 : : *
346 : : * This is also applied to the tlist associated with INSERT ... ON CONFLICT
347 : : * ... UPDATE, although not till much later in planning.
348 : : */
349 : : List *
1821 350 : 13255 : extract_update_targetlist_colnos(List *tlist)
351 : : {
1861 352 : 13255 : List *update_colnos = NIL;
353 : 13255 : AttrNumber nextresno = 1;
354 : : ListCell *lc;
355 : :
356 [ + + + + : 29561 : foreach(lc, tlist)
+ + ]
357 : : {
358 : 16306 : TargetEntry *tle = (TargetEntry *) lfirst(lc);
359 : :
360 [ + + ]: 16306 : if (!tle->resjunk)
361 : 16070 : update_colnos = lappend_int(update_colnos, tle->resno);
362 : 16306 : tle->resno = nextresno++;
363 : : }
364 : 13255 : return update_colnos;
365 : : }
366 : :
367 : :
368 : : /*****************************************************************************
369 : : *
370 : : * TARGETLIST EXPANSION
371 : : *
372 : : *****************************************************************************/
373 : :
374 : : /*
375 : : * expand_insert_targetlist
376 : : * Given a target list as generated by the parser and a result relation,
377 : : * add targetlist entries for any missing attributes, and ensure the
378 : : * non-junk attributes appear in proper field order.
379 : : *
380 : : * Once upon a time we also did more or less this with UPDATE targetlists,
381 : : * but now this code is only applied to INSERT targetlists.
382 : : */
383 : : static List *
461 384 : 45772 : expand_insert_targetlist(PlannerInfo *root, List *tlist, Relation rel)
385 : : {
9684 386 : 45772 : List *new_tlist = NIL;
387 : : ListCell *tlist_item;
388 : : int attrno,
389 : : numattrs;
390 : :
8014 neilc@samurai.com 391 : 45772 : tlist_item = list_head(tlist);
392 : :
393 : : /*
394 : : * The rewriter should have already ensured that the TLEs are in correct
395 : : * order; but we have to insert TLEs for any missing attributes.
396 : : *
397 : : * Scan the tuple description in the relation's relcache entry to make
398 : : * sure we have all the user attributes in the right order.
399 : : */
9684 tgl@sss.pgh.pa.us 400 : 45772 : numattrs = RelationGetNumberOfAttributes(rel);
401 : :
402 [ + + ]: 155140 : for (attrno = 1; attrno <= numattrs; attrno++)
403 : : {
3180 andres@anarazel.de 404 : 109368 : Form_pg_attribute att_tup = TupleDescAttr(rel->rd_att, attrno - 1);
9519 bruce@momjian.us 405 : 109368 : TargetEntry *new_tle = NULL;
406 : :
8014 neilc@samurai.com 407 [ + + ]: 109368 : if (tlist_item != NULL)
408 : : {
409 : 102625 : TargetEntry *old_tle = (TargetEntry *) lfirst(tlist_item);
410 : :
7699 tgl@sss.pgh.pa.us 411 [ + - + + ]: 102625 : if (!old_tle->resjunk && old_tle->resno == attrno)
412 : : {
8796 413 : 95189 : new_tle = old_tle;
2486 414 : 95189 : tlist_item = lnext(tlist, tlist_item);
415 : : }
416 : : }
417 : :
9684 418 [ + + ]: 109368 : if (new_tle == NULL)
419 : : {
420 : : /*
421 : : * Didn't find a matching tlist entry, so make one.
422 : : *
423 : : * INSERTs should insert NULL in this case. (We assume the
424 : : * rewriter would have inserted any available non-NULL default
425 : : * value.) Also, normally we must apply any domain constraints
426 : : * that might exist --- this is to catch domain NOT NULL.
427 : : *
428 : : * When generating a NULL constant for a dropped column, we label
429 : : * it INT4 (any other guaranteed-to-exist datatype would do as
430 : : * well). We can't label it with the dropped column's datatype
431 : : * since that might not exist anymore. It does not really matter
432 : : * what we claim the type is, since NULL is NULL --- its
433 : : * representation is datatype-independent. This could perhaps
434 : : * confuse code comparing the finished plan to the target
435 : : * relation, however.
436 : : *
437 : : * Another exception is that if the column is generated, the value
438 : : * we produce here will be ignored, and we don't want to risk
439 : : * throwing an error. So in that case we *don't* want to apply
440 : : * domain constraints, so we must produce a NULL of the base type.
441 : : * Again, code comparing the finished plan to the target relation
442 : : * must account for this.
443 : : */
444 : : Node *new_expr;
445 : :
385 446 [ + + ]: 14179 : if (att_tup->attisdropped)
447 : : {
448 : : /* Insert NULL for dropped column */
1819 449 : 549 : new_expr = (Node *) makeConst(INT4OID,
450 : : -1,
451 : : InvalidOid,
452 : : sizeof(int32),
453 : : (Datum) 0,
454 : : true, /* isnull */
455 : : true /* byval */ );
456 : : }
385 457 [ + + ]: 13630 : else if (att_tup->attgenerated)
458 : : {
459 : : /* Generated column, insert a NULL of the base type */
460 : 1046 : Oid baseTypeId = att_tup->atttypid;
461 : 1046 : int32 baseTypeMod = att_tup->atttypmod;
462 : :
463 : 1046 : baseTypeId = getBaseTypeAndTypmod(baseTypeId, &baseTypeMod);
464 : 1046 : new_expr = (Node *) makeConst(baseTypeId,
465 : : baseTypeMod,
466 : : att_tup->attcollation,
467 : 1046 : att_tup->attlen,
468 : : (Datum) 0,
469 : : true, /* isnull */
470 : 1046 : att_tup->attbyval);
471 : : }
472 : : else
473 : : {
474 : : /* Normal column, insert a NULL of the column datatype */
475 : 12584 : new_expr = coerce_null_to_domain(att_tup->atttypid,
476 : : att_tup->atttypmod,
477 : : att_tup->attcollation,
478 : 12584 : att_tup->attlen,
479 : 12584 : att_tup->attbyval);
480 : : /* Must run expression preprocessing on any non-const nodes */
481 [ + + ]: 12584 : if (!IsA(new_expr, Const))
482 : 55 : new_expr = eval_const_expressions(root, new_expr);
483 : : }
484 : :
7699 485 : 14179 : new_tle = makeTargetEntry((Expr *) new_expr,
486 : : attrno,
8644 bruce@momjian.us 487 : 14179 : pstrdup(NameStr(att_tup->attname)),
488 : : false);
489 : : }
490 : :
9684 tgl@sss.pgh.pa.us 491 : 109368 : new_tlist = lappend(new_tlist, new_tle);
492 : : }
493 : :
494 : : /*
495 : : * The remaining tlist entries should be resjunk; append them all to the
496 : : * end of the new tlist, making sure they have resnos higher than the last
497 : : * real attribute. (Note: although the rewriter already did such
498 : : * renumbering, we have to do it again here in case we added NULL entries
499 : : * above.)
500 : : */
8014 neilc@samurai.com 501 [ - + ]: 45772 : while (tlist_item)
502 : : {
8014 neilc@samurai.com 503 :UBC 0 : TargetEntry *old_tle = (TargetEntry *) lfirst(tlist_item);
504 : :
7699 tgl@sss.pgh.pa.us 505 [ # # ]: 0 : if (!old_tle->resjunk)
8320 506 [ # # ]: 0 : elog(ERROR, "targetlist is not sorted correctly");
507 : : /* Get the resno right, but don't copy unnecessarily */
7699 508 [ # # ]: 0 : if (old_tle->resno != attrno)
509 : : {
510 : 0 : old_tle = flatCopyTargetEntry(old_tle);
511 : 0 : old_tle->resno = attrno;
512 : : }
8796 513 : 0 : new_tlist = lappend(new_tlist, old_tle);
514 : 0 : attrno++;
2486 515 : 0 : tlist_item = lnext(tlist, tlist_item);
516 : : }
517 : :
9684 tgl@sss.pgh.pa.us 518 :CBC 45772 : return new_tlist;
519 : : }
520 : :
521 : :
522 : : /*
523 : : * Locate PlanRowMark for given RT index, or return NULL if none
524 : : *
525 : : * This probably ought to be elsewhere, but there's no very good place
526 : : */
527 : : PlanRowMark *
6035 528 : 17108 : get_plan_rowmark(List *rowmarks, Index rtindex)
529 : : {
530 : : ListCell *l;
531 : :
532 [ + + + + : 18126 : foreach(l, rowmarks)
+ + ]
533 : : {
534 : 2731 : PlanRowMark *rc = (PlanRowMark *) lfirst(l);
535 : :
536 [ + + ]: 2731 : if (rc->rti == rtindex)
537 : 1713 : return rc;
538 : : }
539 : 15395 : return NULL;
540 : : }
|