diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2023-04-07 10:35:11 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2023-04-07 10:35:11 -0400 |
commit | cd82e5c79d145dddd7a30ed35e4d3b83945b56f3 (patch) | |
tree | 9130cbda9eca639ddc900705a1df6bdcb661e985 | |
parent | 21d7c05a5cf7637cbdf2739006936bb9d279d505 (diff) | |
download | postgresql-cd82e5c79d145dddd7a30ed35e4d3b83945b56f3.tar.gz postgresql-cd82e5c79d145dddd7a30ed35e4d3b83945b56f3.zip |
Fix locale-dependent test case.
psql parses the interval argument of \watch with locale-dependent
strtod(). In commit 00beecfe8 I added a test case that exercises
a fractional interval, but I hard-coded 0.01 which doesn't work
in locales where the radix point isn't ".". We don't want to
change this longstanding parsing behavior, so fix the test case
to generate a suitably locale-aware spelling.
Report and patch by Alexander Korotkov.
Discussion: https://postgr.es/m/CAPpHfdv+10Uk6FWjsh3+ju7kHYr76LaRXbYayXmrM7FBU-=Hgg@mail.gmail.com
-rw-r--r-- | src/bin/psql/t/001_basic.pl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bin/psql/t/001_basic.pl b/src/bin/psql/t/001_basic.pl index 56b1e3e4a6f..596746de178 100644 --- a/src/bin/psql/t/001_basic.pl +++ b/src/bin/psql/t/001_basic.pl @@ -3,6 +3,7 @@ use strict; use warnings; +use locale; use PostgreSQL::Test::Cluster; use PostgreSQL::Test::Utils; @@ -351,9 +352,10 @@ psql_like( ); # Check \watch +# Note: the interval value is parsed with locale-aware strtod() psql_like( $node, - 'SELECT 1 \watch c=3 i=0.01', + sprintf('SELECT 1 \watch c=3 i=%g', 0.01), qr/1\n1\n1/, '\watch with 3 iterations'); |