pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feed9.1beta1 "collate" test failure
4+ messages / 2 participants
[nested] [flat]
* 9.1beta1 "collate" test failure
@ 2011-05-10 12:36 Martin Pitt <mpitt@debian.org>
0 siblings, 1 reply; 4+ messages in thread
From: Martin Pitt @ 2011-05-10 12:36 UTC (permalink / raw)
To: pgsql-bugs
Hello all,
while packaging 9.1 beta1, I noticed that the "collate" test case now
fails (see attached regression.diffs). It seems to work when I run
this under LANG= LANGUAGE= (i. e. in C locale), but it fails under
both en_US.UTF-8 and de_DE.UTF-8.
Is this just a bug/quirk/expectation of the test suite, i. e. should I
always run the tests under the C locale? Or does it actually point
towards an unexpected behaviour?
Thanks,
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
Attachments:
regression.diffs (text/plain, 7.6K) download
*** /home/martin/debian/psql/9.1/postgresql-9.1beta1/src/test/regress/expected/collate.out 2011-04-27 23:17:22.000000000 +0200
--- /home/martin/debian/psql/9.1/postgresql-9.1beta1/src/test/regress/results/collate.out 2011-05-10 14:32:53.116257734 +0200
***************
*** 49,70 ****
a | b
---+-----
1 | abc
3 | bbc
! (2 rows)
SELECT * FROM collate_test1 WHERE b >= 'abc' COLLATE "C";
a | b
---+-----
1 | abc
3 | bbc
! (2 rows)
SELECT * FROM collate_test1 WHERE b COLLATE "C" >= 'abc' COLLATE "C";
a | b
---+-----
1 | abc
3 | bbc
! (2 rows)
SELECT * FROM collate_test1 WHERE b COLLATE "C" >= 'bbc' COLLATE "POSIX"; -- fail
ERROR: collation mismatch between explicit collations "C" and "POSIX"
--- 49,76 ----
a | b
---+-----
1 | abc
+ 2 | Abc
3 | bbc
! 4 | ABD
! (4 rows)
SELECT * FROM collate_test1 WHERE b >= 'abc' COLLATE "C";
a | b
---+-----
1 | abc
+ 2 | Abc
3 | bbc
! 4 | ABD
! (4 rows)
SELECT * FROM collate_test1 WHERE b COLLATE "C" >= 'abc' COLLATE "C";
a | b
---+-----
1 | abc
+ 2 | Abc
3 | bbc
! 4 | ABD
! (4 rows)
SELECT * FROM collate_test1 WHERE b COLLATE "C" >= 'bbc' COLLATE "POSIX"; -- fail
ERROR: collation mismatch between explicit collations "C" and "POSIX"
***************
*** 95,112 ****
SELECT a, b FROM collate_test5 ORDER BY b;
a | b
---+-----
- 4 | ABD
- 2 | Abc
1 | abc
3 | bbc
(4 rows)
SELECT a, b FROM collate_test1 ORDER BY b;
a | b
---+-----
- 4 | ABD
- 2 | Abc
1 | abc
3 | bbc
(4 rows)
--- 101,118 ----
SELECT a, b FROM collate_test5 ORDER BY b;
a | b
---+-----
1 | abc
+ 2 | Abc
+ 4 | ABD
3 | bbc
(4 rows)
SELECT a, b FROM collate_test1 ORDER BY b;
a | b
---+-----
1 | abc
+ 2 | Abc
+ 4 | ABD
3 | bbc
(4 rows)
***************
*** 122,130 ****
SELECT a, b FROM collate_test1 ORDER BY b COLLATE "C";
a | b
---+-----
- 4 | ABD
- 2 | Abc
1 | abc
3 | bbc
(4 rows)
--- 128,136 ----
SELECT a, b FROM collate_test1 ORDER BY b COLLATE "C";
a | b
---+-----
1 | abc
+ 2 | Abc
+ 4 | ABD
3 | bbc
(4 rows)
***************
*** 132,140 ****
SELECT * FROM collate_test1 ORDER BY b;
a | b
---+-----
- 4 | ABD
- 2 | Abc
1 | abc
3 | bbc
(4 rows)
--- 138,146 ----
SELECT * FROM collate_test1 ORDER BY b;
a | b
---+-----
1 | abc
+ 2 | Abc
+ 4 | ABD
3 | bbc
(4 rows)
***************
*** 205,213 ****
SELECT a, coalesce(b, 'foo') FROM collate_test1 ORDER BY 2;
a | coalesce
---+----------
- 4 | ABD
- 2 | Abc
1 | abc
3 | bbc
(4 rows)
--- 211,219 ----
SELECT a, coalesce(b, 'foo') FROM collate_test1 ORDER BY 2;
a | coalesce
---+----------
1 | abc
+ 2 | Abc
+ 4 | ABD
3 | bbc
(4 rows)
***************
*** 230,239 ****
SELECT a, b, greatest(b, 'CCC') FROM collate_test1 ORDER BY 3;
a | b | greatest
---+-----+----------
2 | Abc | CCC
4 | ABD | CCC
- 1 | abc | abc
- 3 | bbc | bbc
(4 rows)
SELECT a, b, greatest(b, 'CCC') FROM collate_test2 ORDER BY 3;
--- 236,245 ----
SELECT a, b, greatest(b, 'CCC') FROM collate_test1 ORDER BY 3;
a | b | greatest
---+-----+----------
+ 1 | abc | CCC
2 | Abc | CCC
+ 3 | bbc | CCC
4 | ABD | CCC
(4 rows)
SELECT a, b, greatest(b, 'CCC') FROM collate_test2 ORDER BY 3;
***************
*** 249,262 ****
a | x | y | lower | lower
---+-----+-----+-------+-------
1 | hij | hij | hij | hij
! 2 | HIJ | HIJ | foo | foo
(2 rows)
SELECT a, nullif(b, 'abc') FROM collate_test1 ORDER BY 2;
a | nullif
---+--------
- 4 | ABD
2 | Abc
3 | bbc
1 |
(4 rows)
--- 255,268 ----
a | x | y | lower | lower
---+-----+-----+-------+-------
1 | hij | hij | hij | hij
! 2 | HIJ | HIJ | hij | foo
(2 rows)
SELECT a, nullif(b, 'abc') FROM collate_test1 ORDER BY 2;
a | nullif
---+--------
2 | Abc
+ 4 | ABD
3 | bbc
1 |
(4 rows)
***************
*** 280,288 ****
SELECT a, CASE b WHEN 'abc' THEN 'abcd' ELSE b END FROM collate_test1 ORDER BY 2;
a | b
---+------
- 4 | ABD
2 | Abc
1 | abcd
3 | bbc
(4 rows)
--- 286,294 ----
SELECT a, CASE b WHEN 'abc' THEN 'abcd' ELSE b END FROM collate_test1 ORDER BY 2;
a | b
---+------
2 | Abc
1 | abcd
+ 4 | ABD
3 | bbc
(4 rows)
***************
*** 299,307 ****
SELECT a, b::testdomain FROM collate_test1 ORDER BY 2;
a | b
---+-----
- 4 | ABD
- 2 | Abc
1 | abc
3 | bbc
(4 rows)
--- 305,313 ----
SELECT a, b::testdomain FROM collate_test1 ORDER BY 2;
a | b
---+-----
1 | abc
+ 2 | Abc
+ 4 | ABD
3 | bbc
(4 rows)
***************
*** 333,339 ****
SELECT min(b), max(b) FROM collate_test1;
min | max
-----+-----
! ABD | bbc
(1 row)
SELECT min(b), max(b) FROM collate_test2;
--- 339,345 ----
SELECT min(b), max(b) FROM collate_test1;
min | max
-----+-----
! abc | bbc
(1 row)
SELECT min(b), max(b) FROM collate_test2;
***************
*** 345,351 ****
SELECT array_agg(b ORDER BY b) FROM collate_test1;
array_agg
-------------------
! {ABD,Abc,abc,bbc}
(1 row)
SELECT array_agg(b ORDER BY b) FROM collate_test2;
--- 351,357 ----
SELECT array_agg(b ORDER BY b) FROM collate_test1;
array_agg
-------------------
! {abc,Abc,ABD,bbc}
(1 row)
SELECT array_agg(b ORDER BY b) FROM collate_test2;
***************
*** 357,368 ****
SELECT a, b FROM collate_test1 UNION ALL SELECT a, b FROM collate_test1 ORDER BY 2;
a | b
---+-----
- 4 | ABD
- 4 | ABD
- 2 | Abc
- 2 | Abc
1 | abc
1 | abc
3 | bbc
3 | bbc
(8 rows)
--- 363,374 ----
SELECT a, b FROM collate_test1 UNION ALL SELECT a, b FROM collate_test1 ORDER BY 2;
a | b
---+-----
1 | abc
1 | abc
+ 2 | Abc
+ 2 | Abc
+ 4 | ABD
+ 4 | ABD
3 | bbc
3 | bbc
(8 rows)
***************
*** 415,423 ****
SELECT a, b COLLATE "C" FROM collate_test1 UNION SELECT a, b FROM collate_test2 ORDER BY 2; -- ok
a | b
---+-----
- 4 | ABD
- 2 | Abc
1 | abc
3 | bbc
(4 rows)
--- 421,429 ----
SELECT a, b COLLATE "C" FROM collate_test1 UNION SELECT a, b FROM collate_test2 ORDER BY 2; -- ok
a | b
---+-----
1 | abc
+ 2 | Abc
+ 4 | ABD
3 | bbc
(4 rows)
***************
*** 464,470 ****
(VALUES ('a', 'B'), ('A', 'b' COLLATE "C")) v(a,b);
a | b | lt
---+---+----
! a | B | f
A | b | t
(2 rows)
--- 470,476 ----
(VALUES ('a', 'B'), ('A', 'b' COLLATE "C")) v(a,b);
a | b | lt
---+---+----
! a | B | t
A | b | t
(2 rows)
***************
*** 476,484 ****
SELECT a, CAST(b AS varchar) FROM collate_test1 ORDER BY 2;
a | b
---+-----
- 4 | ABD
- 2 | Abc
1 | abc
3 | bbc
(4 rows)
--- 482,490 ----
SELECT a, CAST(b AS varchar) FROM collate_test1 ORDER BY 2;
a | b
---+-----
1 | abc
+ 2 | Abc
+ 4 | ABD
3 | bbc
(4 rows)
***************
*** 495,503 ****
SELECT * FROM unnest((SELECT array_agg(b ORDER BY b) FROM collate_test1)) ORDER BY 1;
unnest
--------
- ABD
- Abc
abc
bbc
(4 rows)
--- 501,509 ----
SELECT * FROM unnest((SELECT array_agg(b ORDER BY b) FROM collate_test1)) ORDER BY 1;
unnest
--------
abc
+ Abc
+ ABD
bbc
(4 rows)
***************
*** 515,523 ****
SELECT a, dup(b) FROM collate_test1 ORDER BY 2;
a | dup
---+-----
- 4 | ABD
- 2 | Abc
1 | abc
3 | bbc
(4 rows)
--- 521,529 ----
SELECT a, dup(b) FROM collate_test1 ORDER BY 2;
a | dup
---+-----
1 | abc
+ 2 | Abc
+ 4 | ABD
3 | bbc
(4 rows)
======================================================================
signature.asc (application/pgp-signature, 835B) download
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: 9.1beta1 "collate" test failure
@ 2011-05-10 14:03 Tom Lane <tgl@sss.pgh.pa.us>
parent: Martin Pitt <mpitt@debian.org>
0 siblings, 1 reply; 4+ messages in thread
From: Tom Lane @ 2011-05-10 14:03 UTC (permalink / raw)
To: Martin Pitt <mpitt@debian.org>; +Cc: pgsql-bugs
Martin Pitt <mpitt@debian.org> writes:
> while packaging 9.1 beta1, I noticed that the "collate" test case now
> fails (see attached regression.diffs). It seems to work when I run
> this under LANG= LANGUAGE= (i. e. in C locale), but it fails under
> both en_US.UTF-8 and de_DE.UTF-8.
[ raised eyebrow... ] What platform? This seems to point towards "C"
locale not doing what it is supposed to ...
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: 9.1beta1 "collate" test failure
@ 2011-05-10 14:58 Martin Pitt <mpitt@debian.org>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 4+ messages in thread
From: Martin Pitt @ 2011-05-10 14:58 UTC (permalink / raw)
To: pgsql-bugs
Tom Lane [2011-05-10 10:03 -0400]:
> [ raised eyebrow... ] What platform? This seems to point towards "C"
> locale not doing what it is supposed to ...
After your comment I checked locales on my system, and for some reason
I had an /usr/lib/locales/C.UTF-8/ besides the usual locale-archive. I
cleaned this up, and it works now.
Sorry for the noise!
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: 9.1beta1 "collate" test failure
@ 2011-05-10 15:38 Tom Lane <tgl@sss.pgh.pa.us>
parent: Martin Pitt <mpitt@debian.org>
0 siblings, 0 replies; 4+ messages in thread
From: Tom Lane @ 2011-05-10 15:38 UTC (permalink / raw)
To: Martin Pitt <mpitt@debian.org>; +Cc: pgsql-bugs
Martin Pitt <mpitt@debian.org> writes:
> Tom Lane [2011-05-10 10:03 -0400]:
>> [ raised eyebrow... ] What platform? This seems to point towards "C"
>> locale not doing what it is supposed to ...
> After your comment I checked locales on my system, and for some reason
> I had an /usr/lib/locales/C.UTF-8/ besides the usual locale-archive. I
> cleaned this up, and it works now.
Hmm ... I think that's probably still a bug, actually. Apparently what
happened is that initdb injected an entry for "C" with encoding UTF8
into pg_collation, and then that was used instead of the intended
"all-encodings" C entry, and then since the actual LC_COLLATE string
wasn't precisely "C" we didn't go down the strcmp() code path but used
whatever the locale file said to do ... which evidently wasn't really
"C" behavior.
We probably need to tweak initdb to be real sure it won't add entries
that conflict with the built-in ones. This is already prohibited by
CREATE COLLATION but initdb has to bypass that check.
Thanks for the report!
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2011-05-10 15:38 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-05-10 12:36 9.1beta1 "collate" test failure Martin Pitt <mpitt@debian.org>
2011-05-10 14:03 ` Tom Lane <tgl@sss.pgh.pa.us>
2011-05-10 14:58 ` Martin Pitt <mpitt@debian.org>
2011-05-10 15:38 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox