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

Commitc1f1a2e

Browse files
committed
Allow UNION/UNION ALL in subselects.
1 parent2077ce1 commitc1f1a2e

File tree

4 files changed

+33
-5
lines changed

4 files changed

+33
-5
lines changed

‎src/backend/executor/execAmi.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.21 1998/06/1519:28:18 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/execAmi.c,v 1.22 1998/07/1522:16:17 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -369,6 +369,10 @@ ExecReScan(Plan *node, ExprContext *exprCtxt, Plan *parent)
369369
ExecReScanMergeJoin((MergeJoin*)node,exprCtxt,parent);
370370
break;
371371

372+
caseT_Append:
373+
ExecReScanAppend((Append*)node,exprCtxt,parent);
374+
break;
375+
372376
/*
373377
* Tee is never used
374378
case T_Tee:

‎src/backend/executor/nodeAppend.c

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.13 1998/07/1514:54:30 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAppend.c,v 1.14 1998/07/1522:16:18 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414
/* INTERFACE ROUTINES
1515
*ExecInitAppend- initialize the append node
1616
*ExecProcAppend- retrieve the next tuple from the node
1717
*ExecEndAppend- shut down the append node
18+
*ExecReScanAppend - rescan the append node
1819
*
1920
* NOTES
2021
*Each append node contains a list of one or more subplans which
@@ -34,7 +35,7 @@
3435
* nilnil ...... ...
3536
* subplans
3637
*
37-
*Append nodes are currently usedto unions, and to support inheritance
38+
*Append nodes are currently usedfor unions, and to support inheritance
3839
*queries, where several relations need to be scanned.
3940
*For example, in our standard person/student/employee/student-emp
4041
*example, where student and employee inherit from person
@@ -500,3 +501,25 @@ ExecEndAppend(Append *node)
500501
* appendstate->as_junkfilter_list here
501502
*/
502503
}
504+
void
505+
ExecReScanAppend(Append*node,ExprContext*exprCtxt,Plan*parent)
506+
{
507+
AppendState*appendstate=node->appendstate;
508+
intnplans=length(node->appendplans);
509+
inti;
510+
511+
for (i=0;i<nplans;i++)
512+
{
513+
Plan*rescanNode;
514+
515+
appendstate->as_whichplan=i;
516+
rescanNode= (Plan*)nth(i,node->appendplans);
517+
if (rescanNode->chgParam==NULL)
518+
{
519+
exec_append_initialize_next(node);
520+
ExecReScan((Plan*)rescanNode,exprCtxt, (Plan*)node);
521+
}
522+
}
523+
appendstate->as_whichplan=0;
524+
exec_append_initialize_next(node);
525+
}

‎src/backend/parser/gram.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@
218218
*
219219
*
220220
* IDENTIFICATION
221-
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.15 1998/07/1515:56:34 momjian Exp $
221+
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/gram.c,v 2.16 1998/07/1522:16:18 momjian Exp $
222222
*
223223
* HISTORY
224224
* AUTHORDATEMAJOR EVENT

‎src/include/executor/nodeAppend.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* Copyright (c) 1994, Regents of the University of California
88
*
9-
* $Id: nodeAppend.h,v 1.7 1997/11/26 01:12:44 momjian Exp $
9+
* $Id: nodeAppend.h,v 1.8 1998/07/15 22:16:21 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -21,5 +21,6 @@ extern bool ExecInitAppend(Append *node, EState *estate, Plan *parent);
2121
externintExecCountSlotsAppend(Append*node);
2222
externTupleTableSlot*ExecProcAppend(Append*node);
2323
externvoidExecEndAppend(Append*node);
24+
externvoidExecReScanAppend(Append*node,ExprContext*exprCtxt,Plan*parent);
2425

2526
#endif/* NODEAPPEND_H */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp