~ubuntu-branches/ubuntu/natty/postgresql-8.4/natty-security

« back to all changes in this revision

Viewing changes to src/include/nodes/execnodes.h

Tags: upstream-8.4.0
ImportĀ upstreamĀ versionĀ 8.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
8
8
 * Portions Copyright (c) 1994, Regents of the University of California
9
9
 *
10
 
 * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.204 2009/04/08 21:51:38 petere Exp $
 
10
 * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.205 2009/06/11 14:49:11 momjian Exp $
11
11
 *
12
12
 *-------------------------------------------------------------------------
13
13
 */
18
18
#include "access/heapam.h"
19
19
#include "access/skey.h"
20
20
#include "nodes/params.h"
21
 
#include "nodes/plannodes.h"    
22
 
#include "nodes/tidbitmap.h"    
 
21
#include "nodes/plannodes.h"
 
22
#include "nodes/tidbitmap.h"
23
23
#include "utils/hsearch.h"
24
24
#include "utils/rel.h"
25
25
#include "utils/snapshot.h"
120
120
        ParamListInfo ecxt_param_list_info; /* for other param types */
121
121
 
122
122
        /*
123
 
         * Values to substitute for Aggref nodes in the expressions of an Agg node,
124
 
         * or for WindowFunc nodes within a WindowAgg node.
 
123
         * Values to substitute for Aggref nodes in the expressions of an Agg
 
124
         * node, or for WindowFunc nodes within a WindowAgg node.
125
125
         */
126
126
        Datum      *ecxt_aggvalues; /* precomputed values for aggs/windowfuncs */
127
127
        bool       *ecxt_aggnulls;      /* null flags for aggs/windowfuncs */
383
383
 
384
384
 
385
385
/*
386
 
 * es_rowMarks is a list of these structs.  See RowMarkClause for details
387
 
 * about rti and prti.  toidAttno is not used in a "plain" rowmark.
 
386
 * es_rowMarks is a list of these structs.      See RowMarkClause for details
 
387
 * about rti and prti.  toidAttno is not used in a "plain" rowmark.
388
388
 */
389
389
typedef struct ExecRowMark
390
390
{
578
578
        FmgrInfo        func;
579
579
 
580
580
        /*
581
 
         * For a set-returning function (SRF) that returns a tuplestore, we
582
 
         * keep the tuplestore here and dole out the result rows one at a time.
583
 
         * The slot holds the row currently being returned.
 
581
         * For a set-returning function (SRF) that returns a tuplestore, we keep
 
582
         * the tuplestore here and dole out the result rows one at a time. The
 
583
         * slot holds the row currently being returned.
584
584
         */
585
585
        Tuplestorestate *funcResultStore;
586
586
        TupleTableSlot *funcResultSlot;
587
587
 
588
588
        /*
589
589
         * In some cases we need to compute a tuple descriptor for the function's
590
 
         * output.  If so, it's stored here.
 
590
         * output.      If so, it's stored here.
591
591
         */
592
592
        TupleDesc       funcResultDesc;
593
 
        bool            funcReturnsTuple;       /* valid when funcResultDesc isn't NULL */
 
593
        bool            funcReturnsTuple;               /* valid when funcResultDesc isn't
 
594
                                                                                 * NULL */
594
595
 
595
596
        /*
596
597
         * We need to store argument values across calls when evaluating a SRF
949
950
        TupleTableSlot *ps_ResultTupleSlot; /* slot for my result tuples */
950
951
        ExprContext *ps_ExprContext;    /* node's expression-evaluation context */
951
952
        ProjectionInfo *ps_ProjInfo;    /* info for doing tuple projection */
952
 
        bool            ps_TupFromTlist;        /* state flag for processing set-valued
953
 
                                                                         * functions in targetlist */
 
953
        bool            ps_TupFromTlist;/* state flag for processing set-valued
 
954
                                                                 * functions in targetlist */
954
955
} PlanState;
955
956
 
956
957
/* ----------------
1018
1019
        FmgrInfo   *hashfunctions;      /* per-grouping-field hash fns */
1019
1020
        MemoryContext tempContext;      /* short-term context for comparisons */
1020
1021
        TupleHashTable hashtable;       /* hash table for tuples already seen */
1021
 
        MemoryContext tableContext;     /* memory context containing hash table */
 
1022
        MemoryContext tableContext; /* memory context containing hash table */
1022
1023
} RecursiveUnionState;
1023
1024
 
1024
1025
/* ----------------
1166
1167
 *              tbmres                     current-page data
1167
1168
 *              prefetch_iterator  iterator for prefetching ahead of current page
1168
1169
 *              prefetch_pages     # pages prefetch iterator is ahead of current
1169
 
 *              prefetch_target    target prefetch distance
 
1170
 *              prefetch_target    target prefetch distance
1170
1171
 * ----------------
1171
1172
 */
1172
1173
typedef struct BitmapHeapScanState
1283
1284
        /* Link to the "leader" CteScanState (possibly this same node) */
1284
1285
        struct CteScanState *leader;
1285
1286
        /* The remaining fields are only valid in the "leader" CteScanState */
1286
 
        Tuplestorestate *cte_table;     /* rows already read from the CTE query */
 
1287
        Tuplestorestate *cte_table; /* rows already read from the CTE query */
1287
1288
        bool            eof_cte;                /* reached end of CTE query? */
1288
1289
} CteScanState;
1289
1290
 
1291
1292
 *       WorkTableScanState information
1292
1293
 *
1293
1294
 *              WorkTableScan nodes are used to scan the work table created by
1294
 
 *              a RecursiveUnion node.  We locate the RecursiveUnion node
 
1295
 *              a RecursiveUnion node.  We locate the RecursiveUnion node
1295
1296
 *              during executor startup.
1296
1297
 * ----------------
1297
1298
 */
1526
1527
 
1527
1528
typedef struct WindowAggState
1528
1529
{
1529
 
        ScanState       ss;                                     /* its first field is NodeTag */
 
1530
        ScanState       ss;                             /* its first field is NodeTag */
1530
1531
 
1531
1532
        /* these fields are filled in by ExecInitExpr: */
1532
 
        List       *funcs;                              /* all WindowFunc nodes in targetlist */
1533
 
        int                     numfuncs;                       /* total number of window functions */
1534
 
        int                     numaggs;                        /* number that are plain aggregates */
 
1533
        List       *funcs;                      /* all WindowFunc nodes in targetlist */
 
1534
        int                     numfuncs;               /* total number of window functions */
 
1535
        int                     numaggs;                /* number that are plain aggregates */
1535
1536
 
1536
 
        WindowStatePerFunc perfunc;             /* per-window-function information */
1537
 
        WindowStatePerAgg peragg;               /* per-plain-aggregate information */
 
1537
        WindowStatePerFunc perfunc; /* per-window-function information */
 
1538
        WindowStatePerAgg peragg;       /* per-plain-aggregate information */
1538
1539
        FmgrInfo   *partEqfunctions;    /* equality funcs for partition columns */
1539
 
        FmgrInfo   *ordEqfunctions;             /* equality funcs for ordering columns */
1540
 
        Tuplestorestate    *buffer;             /* stores rows of current partition */
1541
 
        int                     current_ptr;            /* read pointer # for current */
1542
 
        int                     agg_ptr;                        /* read pointer # for aggregates */
1543
 
        int64           spooled_rows;           /* total # of rows in buffer */
1544
 
        int64           currentpos;                     /* position of current row in partition */
1545
 
        int64           frametailpos;           /* current frame tail position */
1546
 
        int64           aggregatedupto;         /* rows before this one are aggregated */
1547
 
 
1548
 
        MemoryContext wincontext;               /* context for partition-lifespan data */
1549
 
        ExprContext *tmpcontext;                /* short-term evaluation context */
1550
 
 
1551
 
        bool            all_done;                       /* true if the scan is finished */
1552
 
        bool            partition_spooled;      /* true if all tuples in current partition
1553
 
                                                                         * have been spooled into tuplestore */
1554
 
        bool            more_partitions;        /* true if there's more partitions after
1555
 
                                                                         * this one */
1556
 
        bool            frametail_valid;        /* true if frametailpos is known up to date
1557
 
                                                                         * for current row */
 
1540
        FmgrInfo   *ordEqfunctions; /* equality funcs for ordering columns */
 
1541
        Tuplestorestate *buffer;        /* stores rows of current partition */
 
1542
        int                     current_ptr;    /* read pointer # for current */
 
1543
        int                     agg_ptr;                /* read pointer # for aggregates */
 
1544
        int64           spooled_rows;   /* total # of rows in buffer */
 
1545
        int64           currentpos;             /* position of current row in partition */
 
1546
        int64           frametailpos;   /* current frame tail position */
 
1547
        int64           aggregatedupto; /* rows before this one are aggregated */
 
1548
 
 
1549
        MemoryContext wincontext;       /* context for partition-lifespan data */
 
1550
        ExprContext *tmpcontext;        /* short-term evaluation context */
 
1551
 
 
1552
        bool            all_done;               /* true if the scan is finished */
 
1553
        bool            partition_spooled;              /* true if all tuples in current
 
1554
                                                                                 * partition have been spooled into
 
1555
                                                                                 * tuplestore */
 
1556
        bool            more_partitions;/* true if there's more partitions after this
 
1557
                                                                 * one */
 
1558
        bool            frametail_valid;/* true if frametailpos is known up to date
 
1559
                                                                 * for current row */
1558
1560
 
1559
1561
        TupleTableSlot *first_part_slot;        /* first tuple of current or next
1560
1562
                                                                                 * partition */
1620
1622
        HeapTuple       grp_firstTuple; /* copy of first tuple of current group */
1621
1623
        /* these fields are used in SETOP_HASHED mode: */
1622
1624
        TupleHashTable hashtable;       /* hash table with one entry per group */
1623
 
        MemoryContext tableContext;     /* memory context containing hash table */
 
1625
        MemoryContext tableContext; /* memory context containing hash table */
1624
1626
        bool            table_filled;   /* hash table filled yet? */
1625
1627
        TupleHashIterator hashiter; /* for iterating through hash table */
1626
1628
} SetOpState;