BETWEEN Help - Mailing list pgsql-patches

From Christopher Kings-Lynne
Subject BETWEEN Help
Date
Msg-id 00b301c1e370$bb50edd0$0200a8c0@SOL
Whole thread Raw
Responses Re: BETWEEN Help
List pgsql-patches
Hi all,

I'm working on making the BETWEEN expression its own node type.  I've
handled most of it I think, but I'm having trouble with the actual
execQual.c.  ie. I don't know how to do it!

Do I recursively call the functions for evaluating Ands, Ors and Ops??

Attached is my current code.  It's sort of half real code and half pseudo.
The exact bits I need the advice on really are bits like this:

 if (expr_result >= lexpr_result &&
                                expr_result <= rexpr_result)

I know this won't work, but how do I make it work?

It's checking that the expression is between the two other expressions.

BTW, I'm just making a BETWEEN node.  I see no need to create a NOT BETWEEN
node, as there is already a NOT node that should just be able to take a
BETWEEN node?

I have made changes in the following files:

outFuncs.c <-- still figuring out the output format..
readFuncs.c <-- dependent on above I think
copyFuncs.c
equalFuncs.c
parsenodes.h
nodes.h
gram.y
execQual.c

parse_expr.c <-- don't know exactly what changes to make here

Chris


Attachment

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [patch] fe-connect.c doesn't handle EINTR correctly
Next
From: Bruce Momjian
Date:
Subject: Re: JDBC PreparedStatement Memory Leak.