Re: NOT boolfield kills backend

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: lockhart(at)alumni(dot)caltech(dot)edu (Thomas G(dot) Lockhart)
Cc: hackers(at)postgreSQL(dot)org
Subject: Re: NOT boolfield kills backend
Date: 1998-09-22 21:20:12
Message-ID: 199809222121.RAA03069@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Hey Bruce! I've got some questions for the original topic, which was the
> failure of
>
> select not b from t;
>
> where b is a boolean type in table t.
>
> It looks to me that the NOT_EXPR expression node is being constructed
> correctly in the parser, but somewhere between the parser and the
> executor (at ExecSeqScan()) it is being transformed into a deficient
> OP_EXPR expression node. Any hints on other places where this query tree
> might be getting transformed or manipulated? If I brute force substitute
> the expression type to be NOT_EXPR in ExecEvalExpr() then the query
> completes successfully:
>
> postgres=> select not b from t1;
> ?column?
> --------
> f
> t
> (2 rows)
>
> Hints are appreciated, or if this is touching on areas you are already
> familiar with I can send my debugging patches...
>
> - Tom
>

Fixed. The last part of the 'if' statement in flatten_tlistentry() was
creating an expr that was assumed to be an OP_EXPR, while it was not in
this case.

---------------------------------------------------------------------------


test=> select x from test;
x
-
f
(1 row)

test=> select not x from test;
?column?
--------
t
(1 row)

--
Bruce Momjian | 830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us | Drexel Hill, Pennsylvania 19026
http://www.op.net/~candle | (610) 353-9879(w)
+ If your life is a hard drive, | (610) 853-3000(h)
+ Christ can be your backup. |

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-09-22 21:20:56 Re: [HACKERS] select not b from t1 -- electric fence
Previous Message Bruce Momjian 1998-09-22 20:45:25 funny comment