Re: [HACKERS] BUG ON HAVING CLAUSE

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: vadim(at)krs(dot)ru (Vadim Mikheev)
Cc: sferac(at)bo(dot)nettuno(dot)it, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] BUG ON HAVING CLAUSE
Date: 1998-12-13 04:27:11
Message-ID: 199812130427.XAA14044@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Added to TODO:

* subqueries containing HAVING return incorrect results

> Sferacarta Software wrote:
> >
> > >> Seems that I found a bug on HAVING clause, see attached file.
> > >>
> >
> > VM> Could you post me data for 8342 rows ?
> >
> > I think this bug is not on HAVING but on IN/ANY/ALL, I tried all these
>
> This is bug on handling HAVING in subqueries.
> There was no HAVING when I was implementing subqueries and
> so I didn't care... The bug is in optimizer:
>
> vac=> explain select * from test where x in (select * from test group by x having 1 < count(x));
> NOTICE: QUERY PLAN:
>
> Seq Scan on test (cost=0.00 size=0 width=4)
> SubPlan
> -> Aggregate (cost=0.00 size=0 width=0)
> ! InitPlan
> ! -> Aggregate (cost=0.00 size=0 width=0)
> ! -> Seq Scan on test (cost=0.00 size=0 width=4)
>
> There must be no InitPlan here...
>
> -> Group (cost=0.00 size=0 width=0)
> -> Sort (cost=0.00 size=0 width=0)
> -> Seq Scan on test (cost=0.00 size=0 width=4)
>
> Currently, my local copy of dev-tree is broken and so I can't
> fix this. I'll return to this bug latter if no one else...
>
> Vadim
>
>

--
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

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-12-13 04:28:22 Re: [HACKERS] redolog - for discussion
Previous Message Bruce Momjian 1998-12-13 04:26:03 Re: [HACKERS] Nag: postgresql/c.h typedefs Size as 'unsigned int' on Alpha