Avoid locale-dependent output in numericlocale check.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 26 Nov 2018 20:30:11 +0000 (15:30 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 26 Nov 2018 20:30:24 +0000 (15:30 -0500)
I'd forgotten that in the buildfarm, parts of the regression tests
may run with psql exposed to a non-default LC_NUMERIC setting.
Hence we can't assume that C locale prevails, nor is there any
accessible way to force the setting for this single test step.
Lobotomize the test case added by commit 9a98984f4 so that it covers as
much as we can of print.c without having any locale-varying output.

src/test/regress/expected/psql.out
src/test/regress/sql/psql.sql

index b6face58e396a77e2e9842d3c100aeb3876f8ace..f4975464f6a54ad36d8231c5387dd85d6ee2b8cb 100644 (file)
@@ -2773,18 +2773,18 @@ Argument data types | numeric
 Type                | func
 
 \pset tuples_only false
--- test numericlocale (not too interesting in C locale, but ...)
+-- test numericlocale (as best we can without control of psql's locale)
 \pset format aligned
 \pset expanded off
 \pset numericlocale true
-select n, -n as m, n * 1000 + 111.1111 as x, '1e90'::float8 as f
+select n, -n as m, n * 111 as x, '1e90'::float8 as f
 from generate_series(0,3) n;
- n | m  |     x      |   f   
----+----+------------+-------
- 0 |  0 |   111.1111 | 1e+90
- 1 | -1 | 1,111.1111 | 1e+90
- 2 | -2 | 2,111.1111 | 1e+90
- 3 | -3 | 3,111.1111 | 1e+90
+ n | m  |  x  |   f   
+---+----+-----+-------
+ 0 |  0 |   0 | 1e+90
+ 1 | -1 | 111 | 1e+90
+ 2 | -2 | 222 | 1e+90
+ 3 | -3 | 333 | 1e+90
 (4 rows)
 
 \pset numericlocale false
index bfe02d12be0d7e4b2867d501205ca7ad09e8d001..9ac6c2080419da097a99d95fc55cb3f44e343370 100644 (file)
@@ -448,13 +448,13 @@ select 1 where false;
 \df exp
 \pset tuples_only false
 
--- test numericlocale (not too interesting in C locale, but ...)
+-- test numericlocale (as best we can without control of psql's locale)
 
 \pset format aligned
 \pset expanded off
 \pset numericlocale true
 
-select n, -n as m, n * 1000 + 111.1111 as x, '1e90'::float8 as f
+select n, -n as m, n * 111 as x, '1e90'::float8 as f
 from generate_series(0,3) n;
 
 \pset numericlocale false