Skip to content

Navigation Menu

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

Appearance settings

Commit cd82e5c

Browse filesBrowse files
committed
Fix locale-dependent test case.
psql parses the interval argument of \watch with locale-dependent strtod(). In commit 00beecf 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
1 parent 21d7c05 commit cd82e5c
Copy full SHA for cd82e5c

File tree

1 file changed

+3
-1
lines changed
Filter options

1 file changed

+3
-1
lines changed

‎src/bin/psql/t/001_basic.pl

Copy file name to clipboardExpand all lines: src/bin/psql/t/001_basic.pl
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
use strict;
55
use warnings;
6+
use locale;
67

78
use PostgreSQL::Test::Cluster;
89
use PostgreSQL::Test::Utils;
@@ -351,9 +352,10 @@ sub psql_fails_like
351352
);
352353

353354
# Check \watch
355+
# Note: the interval value is parsed with locale-aware strtod()
354356
psql_like(
355357
$node,
356-
'SELECT 1 \watch c=3 i=0.01',
358+
sprintf('SELECT 1 \watch c=3 i=%g', 0.01),
357359
qr/1\n1\n1/,
358360
'\watch with 3 iterations');
359361

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.