From 95dcb8fc0580c7b1c5f480b3ecaf81c5fc9801ba Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 26 Nov 2018 15:30:11 -0500 Subject: [PATCH] Avoid locale-dependent output in numericlocale check. 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 | 16 ++++++++-------- src/test/regress/sql/psql.sql | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test/regress/expected/psql.out b/src/test/regress/expected/psql.out index b6face58e3..f4975464f6 100644 --- a/src/test/regress/expected/psql.out +++ b/src/test/regress/expected/psql.out @@ -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 diff --git a/src/test/regress/sql/psql.sql b/src/test/regress/sql/psql.sql index bfe02d12be..9ac6c20804 100644 --- a/src/test/regress/sql/psql.sql +++ b/src/test/regress/sql/psql.sql @@ -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