From: | Jeroen van Vianen <jeroenv(at)design(dot)nl> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Subject: | Bug in evaluation of AND |
Date: | 1998-02-18 08:57:21 |
Message-ID: | 34EAA238.7AF6@design.nl |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
[This email didn't show up on the list when I sent it last monday, so
here it is again].
Hi,
I found the following bug in sunday's snapshot (I am running Linux
2.1.85 and gcc 2.8.0):
I created a table with one column and inserted one row:
jeroenv=> create table test ( a int4 );
CREATE
jeroenv=> insert into test values ( 1 );
INSERT 321708 1
Some checks:
jeroenv=> select a from test where (a=1);
a
-
1
(1 row)
jeroenv=> select a from test where (a=1) and true;
a
-
1
(1 row)
Now, instead of column 'a' I return the constant 1:
jeroenv=> select 1 from test where (a=1);
?column?
--------
1
(1 row)
jeroenv=> select 1 from test where (a=1) and true;
?column?
--------
(0 rows)
No rows is not what I would expect.
However, with 'or' instead of 'and' returning a const value the query
works OK:
jeroenv=> select 1 from test where (a=1) or true;
?column?
--------
1
(1 row)
jeroenv=> select 1 from test where (a=1) or false;
?column?
--------
1
(1 row)
Cheers,
Jeroen van Vianen
From | Date | Subject | |
---|---|---|---|
Next Message | Vadim B. Mikheev | 1998-02-18 09:28:31 | Re: [HACKERS] ecpg stuff |
Previous Message | Vadim B. Mikheev | 1998-02-18 08:55:40 | Re: [HACKERS] ecpg stuff |