Re: BUG #6079: Wrong select result - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #6079: Wrong select result
Date
Msg-id 17006.1309391146@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #6079: Wrong select result  (Dean Rasheed <dean.a.rasheed@gmail.com>)
List pgsql-bugs
Dean Rasheed <dean.a.rasheed@gmail.com> writes:
>> 2011/6/28 Renat <renat.nasyrov@itv.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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #6082: server segfault - pg_stat_reset_shared(null)
Next
From: Craig Ringer
Date:
Subject: Re: BUG #6084: When Updating Tables with Select Into