Re: [HACKERS] Severe SUBSELECT bug in 6.5 CVS

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: "[Jos_] Soares" <jose(at)sferacarta(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Chris Bitmead <chris(dot)bitmead(at)bigfoot(dot)com>, pgsql-hackers(at)hub(dot)org
Subject: Re: [HACKERS] Severe SUBSELECT bug in 6.5 CVS
Date: 1999-06-28 18:39:28
Message-ID: 199906281839.OAA21554@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > > It appears to me that to follow the SQL spec, a NULL found in a.i
> > > should return NULL for both IN and NOT IN (the spec appears to say that
> > > the result of IN is "unknown" in that case, and we are using NULL to
> > > represent "unknown"):
> >
> > I would be interested to see how other databases handle this.
> >
>
> ----------------------------------------------
> create table a (i int, aa char(10));
> create table b (i int, bb char(10));
> insert into a values(1, 'foo');
> insert into b values(null, 'bar');
> select * from a where i not in (select i from b);
> -----------------------------------------------
> I tried the above script on:
>
> Informix-SE
> Oracle8
>
> and both of them return 0 rows, like PostgreSQL.
>

Yes, this is how I remembered Informix doing it. Returning a NULL in
the subselect does not match anything, so hopefully we don't have a bug.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Edmund Mergl 1999-06-28 19:21:33 Re: [HACKERS] Perl library (was Building Postgres)
Previous Message Bruce Momjian 1999-06-28 18:37:44 Re: [HACKERS] regression bigtest needs very long time