diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-07-18 04:41:46 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-07-18 04:41:46 +0000 |
commit | 3e22406ec63b60ed50d3d0c593f9e84b5e1d058b (patch) | |
tree | 9cd544d8f473a766e21629227f615bd536d0359d /src/backend/nodes/outfuncs.c | |
parent | 7ea5f1d7f16e9771e90c020db93d7e8a9a3b22f5 (diff) |
Finished the Between patch Christopher started.
Implements between (symmetric / asymmetric) as a node.
Executes the left or right expression once, makes a Const out of the
resulting Datum and executes the >=, <= portions out of the Const sets.
Of course, the parser does a fair amount of preparatory work for this to
happen.
Rod Taylor
Diffstat (limited to 'src/backend/nodes/outfuncs.c')
-rw-r--r-- | src/backend/nodes/outfuncs.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index a9e6a8382d5..04721d64754 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -5,7 +5,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.163 2002/07/16 22:12:19 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.164 2002/07/18 04:41:44 momjian Exp $ * * NOTES * Every (plan) node in POSTGRES has an associated "out" routine which @@ -1484,6 +1484,38 @@ _outCaseWhen(StringInfo str, CaseWhen *node) } /* + * BetweenExpr + */ +static void +_outBetweenExpr(StringInfo str, BetweenExpr *node) +{ + appendStringInfo(str, " BETWEENEXPR :expr "); + _outNode(str, node->expr); + + appendStringInfo(str, " :not %s", + booltostr(node->not)); + + appendStringInfo(str, " :symmetric %s", + booltostr(node->symmetric)); + + appendStringInfo(str, " :lexpr "); + _outNode(str, node->lexpr); + + appendStringInfo(str, " :rexpr "); + _outNode(str, node->rexpr); + + appendStringInfo(str, " :gthan "); + _outNode(str, node->gthan); + + appendStringInfo(str, " :lthan "); + _outNode(str, node->lthan); + + appendStringInfo(str, " :typeid %u :typelen %d :typebyval %s", + node->typeId, node->typeLen, + booltostr(node->typeByVal)); +} + +/* * NullTest */ static void @@ -1767,6 +1799,9 @@ _outNode(StringInfo str, void *obj) case T_CaseExpr: _outCaseExpr(str, obj); break; + case T_BetweenExpr: + _outBetweenExpr(str, obj); + break; case T_CaseWhen: _outCaseWhen(str, obj); break; |