BETWEEN Help

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема BETWEEN Help
Дата
Msg-id 00b301c1e370$bb50edd0$0200a8c0@SOL
обсуждение исходный текст
Ответы Re: BETWEEN Help  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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


Вложения

В списке pgsql-patches по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [patch] fe-connect.c doesn't handle EINTR correctly
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: JDBC PreparedStatement Memory Leak.