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/equalfuncs.c | |
parent | 7ea5f1d7f16e9771e90c020db93d7e8a9a3b22f5 (diff) | |
download | postgresql-3e22406ec63b60ed50d3d0c593f9e84b5e1d058b.tar.gz postgresql-3e22406ec63b60ed50d3d0c593f9e84b5e1d058b.zip |
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/equalfuncs.c')
-rw-r--r-- | src/backend/nodes/equalfuncs.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c index ed5d638f0cb..92132942948 100644 --- a/src/backend/nodes/equalfuncs.c +++ b/src/backend/nodes/equalfuncs.c @@ -20,7 +20,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.141 2002/07/16 22:12:19 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.142 2002/07/18 04:41:44 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -1770,6 +1770,33 @@ _equalCaseExpr(CaseExpr *a, CaseExpr *b) } static bool +_equalBetweenExpr(BetweenExpr *a, BetweenExpr *b) +{ + if (!equal(a->expr, b->expr)) + return false; + if (!equal(a->lexpr, b->lexpr)) + return false; + if (!equal(a->rexpr, b->rexpr)) + return false; + if (!equal(a->lthan, b->lthan)) + return false; + if (!equal(a->gthan, b->gthan)) + return false; + if (a->symmetric != b->symmetric) + return false; + if (a->not != b->not) + return false; + if (a->typeId != b->typeId) + return false; + if (a->typeLen != b->typeLen) + return false; + if (a->typeByVal != b->typeByVal) + return false; + + return true; +} + +static bool _equalCaseWhen(CaseWhen *a, CaseWhen *b) { if (!equal(a->expr, b->expr)) @@ -2217,6 +2244,9 @@ equal(void *a, void *b) case T_CaseExpr: retval = _equalCaseExpr(a, b); break; + case T_BetweenExpr: + retval = _equalBetweenExpr(a, b); + break; case T_CaseWhen: retval = _equalCaseWhen(a, b); break; |