Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbcc15f1

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 awhile, $> > script. It must have, because that is how I created the expectedfile. :(> >> > A patch to the regression will be forthcoming.>
1 parent58fdae0 commitbcc15f1

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+
#ifdefUSE_LOCALE
614614
byte= (unsignedchar) (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: SELECTmax(a) FROM test_having
13-
GROUP BYlower(c) HAVING count(*)> 2 OR min(b) = 3;
14-
max
15-
---
16-
5
17-
9
12+
QUERY: SELECTb, c FROM test_having
13+
GROUP BYb, 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_havingVALUES (8,4,'CCCC','I');
1616
INSERT INTO test_havingVALUES (9,4,'CCCC','j');
1717

18-
SELECTmax(a)FROM test_having
19-
GROUP BYlower(c)HAVINGcount(*)>2ORmin(b)=3;
18+
SELECTb, cFROM test_having
19+
GROUP BYb, cHAVINGcount(*)=1;
2020

2121
SELECTlower(c),count(c)FROM test_having
2222
GROUP BYlower(c)HAVINGcount(*)>2ORmin(a)=max(a);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp