> David Hartwig wrote:

>
> Please apply this HAVING regression patch.
> > My bad.   It is caused by a known bug having to do with GROUP BY.
It ain't$
> > nothing to do with HAVING.  For some reason the bug went away for a
while, $
> > script.  It must have, because that is how I created the expected
file.   :(
> >
> > A patch to the regression will be forthcoming.
>
This commit is contained in:
Bruce Momjian 1998-09-02 23:37:13 +00:00
parent 58fdae0ddf
commit bcc15f15e1
3 changed files with 13 additions and 11 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.42 1998/09/01 04:32:54 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.43 1998/09/02 23:37:08 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -610,9 +610,11 @@ byteaGetByte(text *v, int32 n)
elog(ERROR, "byteaGetByte: index (=%d) out of range [0..%d]",
n, len - 1);
}
#ifdef USE_LOCALE
byte = (unsigned char) (v->vl_dat[n]);
#else
byte = v->vl_dat[n];
#endif
return (int32) byte;
}

View File

@ -9,12 +9,12 @@ QUERY: INSERT INTO test_having VALUES (6, 4, 'cccc', 'g');
QUERY: INSERT INTO test_having VALUES (7, 4, 'cccc', 'h');
QUERY: INSERT INTO test_having VALUES (8, 4, 'CCCC', 'I');
QUERY: INSERT INTO test_having VALUES (9, 4, 'CCCC', 'j');
QUERY: SELECT max(a) FROM test_having
GROUP BY lower(c) HAVING count(*) > 2 OR min(b) = 3;
max
---
5
9
QUERY: SELECT b, c FROM test_having
GROUP BY b, c HAVING count(*) = 1;
b|c
-+--------
1|XXXX
3|bbbb
(2 rows)
QUERY: SELECT lower(c), count(c) FROM test_having

View File

@ -15,8 +15,8 @@ INSERT INTO test_having VALUES (7, 4, 'cccc', 'h');
INSERT INTO test_having VALUES (8, 4, 'CCCC', 'I');
INSERT INTO test_having VALUES (9, 4, 'CCCC', 'j');
SELECT max(a) FROM test_having
GROUP BY lower(c) HAVING count(*) > 2 OR min(b) = 3;
SELECT b, c FROM test_having
GROUP BY b, c HAVING count(*) = 1;
SELECT lower(c), count(c) FROM test_having
GROUP BY lower(c) HAVING count(*) > 2 OR min(a) = max(a);