Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bcc15f1

Browse files
committed
> 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. >
1 parent 58fdae0 commit bcc15f1

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

src/backend/utils/adt/varlena.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.42 1998/09/01 04:32:54 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.43 1998/09/02 23:37:08 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -610,9 +610,11 @@ byteaGetByte(text *v, int32 n)
610610
elog(ERROR, "byteaGetByte: index (=%d) out of range [0..%d]",
611611
n, len - 1);
612612
}
613-
613+
#ifdef USE_LOCALE
614614
byte = (unsigned char) (v->vl_dat[n]);
615-
615+
#else
616+
byte = v->vl_dat[n];
617+
#endif
616618
return (int32) byte;
617619
}
618620

src/test/regress/expected/select_having.out

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ QUERY: INSERT INTO test_having VALUES (6, 4, 'cccc', 'g');
99
QUERY: INSERT INTO test_having VALUES (7, 4, 'cccc', 'h');
1010
QUERY: INSERT INTO test_having VALUES (8, 4, 'CCCC', 'I');
1111
QUERY: INSERT INTO test_having VALUES (9, 4, 'CCCC', 'j');
12-
QUERY: SELECT max(a) FROM test_having
13-
GROUP BY lower(c) HAVING count(*) > 2 OR min(b) = 3;
14-
max
15-
---
16-
5
17-
9
12+
QUERY: SELECT b, c FROM test_having
13+
GROUP BY b, c HAVING count(*) = 1;
14+
b|c
15+
-+--------
16+
1|XXXX
17+
3|bbbb
1818
(2 rows)
1919

2020
QUERY: SELECT lower(c), count(c) FROM test_having

src/test/regress/sql/select_having.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ INSERT INTO test_having VALUES (7, 4, 'cccc', 'h');
1515
INSERT INTO test_having VALUES (8, 4, 'CCCC', 'I');
1616
INSERT INTO test_having VALUES (9, 4, 'CCCC', 'j');
1717

18-
SELECT max(a) FROM test_having
19-
GROUP BY lower(c) HAVING count(*) > 2 OR min(b) = 3;
18+
SELECT b, c FROM test_having
19+
GROUP BY b, c HAVING count(*) = 1;
2020

2121
SELECT lower(c), count(c) FROM test_having
2222
GROUP BY lower(c) HAVING count(*) > 2 OR min(a) = max(a);

0 commit comments

Comments
 (0)