pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Renat <renat.nasyrov@itv.ru>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6079: Wrong select result
Date: Wed, 29 Jun 2011 19:45:46 -0400
Message-ID: <17006.1309391146@sss.pgh.pa.us> (raw)
In-Reply-To: <BANLkTikwdP9utpjNTb9p7SmBJf57KPFMtA@mail.gmail.com>
References: <201106281441.p5SEfU5x051446@wwwmaster.postgresql.org>
	<BANLkTik8Ew3Hqf9Hpqwn88XDj=q0AM7DUA@mail.gmail.com>
	<BANLkTikwdP9utpjNTb9p7SmBJf57KPFMtA@mail.gmail.com>

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



view thread (4+ messages)

Message-ID: <17006.1309391146@sss.pgh.pa.us>
Permalink:  ../17006.1309391146@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17006.1309391146@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dean.a.rasheed@gmail.com, pavel.stehule@gmail.com, renat.nasyrov@itv.ru
  Subject: Re: BUG #6079: Wrong select result
  In-Reply-To: <17006.1309391146@sss.pgh.pa.us>
  References: <201106281441.p5SEfU5x051446@wwwmaster.postgresql.org> <BANLkTik8Ew3Hqf9Hpqwn88XDj=q0AM7DUA@mail.gmail.com> <BANLkTikwdP9utpjNTb9p7SmBJf57KPFMtA@mail.gmail.com> <17006.1309391146@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox