diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-12-28 01:30:02 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-12-28 01:30:02 +0000 |
commit | 6e07709760a29d8dbfb93b9846c905bd40689082 (patch) | |
tree | 9bf0084587d7e313ba087ce53c24bc748c63a456 /src/include/nodes/execnodes.h | |
parent | a37422e042a6114ab0e513f50dac4a47fab22313 (diff) |
Implement SQL-compliant treatment of row comparisons for < <= > >= cases
(previously we only did = and <> correctly). Also, allow row comparisons
with any operators that are in btree opclasses, not only those with these
specific names. This gets rid of a whole lot of indefensible assumptions
about the behavior of particular operators based on their names ... though
it's still true that IN and NOT IN expand to "= ANY". The patch adds a
RowCompareExpr expression node type, and makes some changes in the
representation of ANY/ALL/ROWCOMPARE SubLinks so that they can share code
with RowCompareExpr.
I have not yet done anything about making RowCompareExpr an indexable
operator, but will look at that soon.
initdb forced due to changes in stored rules.
Diffstat (limited to 'src/include/nodes/execnodes.h')
-rw-r--r-- | src/include/nodes/execnodes.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 062985aacf3..d07dc57297c 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.146 2005/12/02 20:03:42 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.147 2005/12/28 01:30:01 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -563,7 +563,7 @@ typedef struct SubPlanState ExprState xprstate; EState *sub_estate; /* subselect plan has its own EState */ struct PlanState *planstate; /* subselect plan's state tree */ - List *exprs; /* states of combining expression(s) */ + ExprState *testexpr; /* state of combining expression */ List *args; /* states of argument expression(s) */ bool needShutdown; /* TRUE = need to shutdown subplan */ HeapTuple curTuple; /* copy of most recent tuple from subplan */ @@ -672,6 +672,18 @@ typedef struct RowExprState } RowExprState; /* ---------------- + * RowCompareExprState node + * ---------------- + */ +typedef struct RowCompareExprState +{ + ExprState xprstate; + List *largs; /* the left-hand input arguments */ + List *rargs; /* the right-hand input arguments */ + FmgrInfo *funcs; /* array of comparison function info */ +} RowCompareExprState; + +/* ---------------- * CoalesceExprState node * ---------------- */ |