Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
Appearance settings

Commitcd82e5c

Browse files
committed
Fix locale-dependent test case.
psql parses the interval argument of \watch with locale-dependentstrtod(). In commit00beecf I added a test case that exercisesa fractional interval, but I hard-coded 0.01 which doesn't workin locales where the radix point isn't ".". We don't want tochange this longstanding parsing behavior, so fix the test caseto 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 parent21d7c05 commitcd82e5c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines 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)

[8]ページ先頭

©2009-2025 Movatter.jp