BETWEEN Help

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: <pgsql-patches(at)postgresql(dot)org>
Subject: BETWEEN Help
Date: 2002-04-14 04:56:25
Message-ID: 00b301c1e370$bb50edd0$0200a8c0@SOL
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
snippet.c application/octet-stream 2.5 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2002-04-14 05:02:59 Re: [PATCHES] WITH DELIMITERS in COPY
Previous Message Bruce Momjian 2002-04-14 04:54:46 Re: [PATCHES] [patch] fe-connect.c doesn't handle EINTR correctly