Skip to content

Commit 2226b41

Browse files
committed
Change SeqScan node to contain Scan node
This makes the structure of all Scan-derived nodes the same, independent of whether they have additional fields. Discussion: https://www.postgresql.org/message-id/flat/c1097590-a6a4-486a-64b1-e1f9cc0533ce@enterprisedb.com
1 parent 00116de commit 2226b41

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

src/backend/executor/nodeSeqscan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ ExecInitSeqScan(SeqScan *node, EState *estate, int eflags)
151151
*/
152152
scanstate->ss.ss_currentRelation =
153153
ExecOpenScanRelation(estate,
154-
node->scanrelid,
154+
node->scan.scanrelid,
155155
eflags);
156156

157157
/* and create slot with the appropriate rowtype */
@@ -169,7 +169,7 @@ ExecInitSeqScan(SeqScan *node, EState *estate, int eflags)
169169
* initialize child expressions
170170
*/
171171
scanstate->ss.ps.qual =
172-
ExecInitQual(node->plan.qual, (PlanState *) scanstate);
172+
ExecInitQual(node->scan.plan.qual, (PlanState *) scanstate);
173173

174174
return scanstate;
175175
}

src/backend/nodes/readfuncs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1833,7 +1833,7 @@ _readSeqScan(void)
18331833
{
18341834
READ_LOCALS_NO_FIELDS(SeqScan);
18351835

1836-
ReadCommonScan(local_node);
1836+
ReadCommonScan(&local_node->scan);
18371837

18381838
READ_DONE();
18391839
}

src/backend/optimizer/plan/createplan.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2855,7 +2855,7 @@ create_seqscan_plan(PlannerInfo *root, Path *best_path,
28552855
scan_clauses,
28562856
scan_relid);
28572857

2858-
copy_generic_path_info(&scan_plan->plan, best_path);
2858+
copy_generic_path_info(&scan_plan->scan.plan, best_path);
28592859

28602860
return scan_plan;
28612861
}
@@ -5369,13 +5369,13 @@ make_seqscan(List *qptlist,
53695369
Index scanrelid)
53705370
{
53715371
SeqScan *node = makeNode(SeqScan);
5372-
Plan *plan = &node->plan;
5372+
Plan *plan = &node->scan.plan;
53735373

53745374
plan->targetlist = qptlist;
53755375
plan->qual = qpqual;
53765376
plan->lefttree = NULL;
53775377
plan->righttree = NULL;
5378-
node->scanrelid = scanrelid;
5378+
node->scan.scanrelid = scanrelid;
53795379

53805380
return node;
53815381
}

src/backend/optimizer/plan/setrefs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -516,12 +516,12 @@ set_plan_refs(PlannerInfo *root, Plan *plan, int rtoffset)
516516
{
517517
SeqScan *splan = (SeqScan *) plan;
518518

519-
splan->scanrelid += rtoffset;
520-
splan->plan.targetlist =
521-
fix_scan_list(root, splan->plan.targetlist,
519+
splan->scan.scanrelid += rtoffset;
520+
splan->scan.plan.targetlist =
521+
fix_scan_list(root, splan->scan.plan.targetlist,
522522
rtoffset, NUM_EXEC_TLIST(plan));
523-
splan->plan.qual =
524-
fix_scan_list(root, splan->plan.qual,
523+
splan->scan.plan.qual =
524+
fix_scan_list(root, splan->scan.plan.qual,
525525
rtoffset, NUM_EXEC_QUAL(plan));
526526
}
527527
break;

src/include/nodes/plannodes.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,10 @@ typedef struct Scan
348348
* sequential scan node
349349
* ----------------
350350
*/
351-
typedef Scan SeqScan;
351+
typedef struct SeqScan
352+
{
353+
Scan scan;
354+
} SeqScan;
352355

353356
/* ----------------
354357
* table sample scan node

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