Skip site navigation (1) Skip section navigation (2)

Re: BUG #6079: Wrong select result

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Renat <renat(dot)nasyrov(at)itv(dot)ru>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6079: Wrong select result
Date: 2011-06-29 23:45:46
Message-ID: 17006.1309391146@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> writes:
>> 2011/6/28 Renat <renat(dot)nasyrov(at)itv(dot)ru>:
>>> select * from foo where date_to is null and date_to > '2011-01-01'
>>> Expected: 0 rows
>>> But: it return 1 row with id=2

> The problem seems to be in _bt_preprocess_keys(), which discards the
> "a > 10000" predicate in favour of the "a is null" predicate on the
> grounds that "null > 10000" in a nulls-last index.

> It looks like a previous revision had the right check, based on the
> logic that x IS NULL is incompatible with any other predicate.

Yeah, seems to be my fault :-(.  Will fix.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Craig RingerDate: 2011-06-30 00:34:52
Subject: Re: BUG #6084: When Updating Tables with Select Into
Previous:From: Tom LaneDate: 2011-06-29 21:52:22
Subject: Re: BUG #6082: server segfault - pg_stat_reset_shared(null)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group