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

Appearance settings

Commit 6050622

Browse filesBrowse files
committed
Use locale-aware value for \watch in 005_timeouts.pl
Reported-by: Alexander Lakhin
1 parent 196eeb6 commit 6050622
Copy full SHA for 6050622

File tree

Expand file treeCollapse file tree

1 file changed

+11
-7
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-7
lines changed

‎src/test/modules/test_misc/t/005_timeouts.pl

Copy file name to clipboardExpand all lines: src/test/modules/test_misc/t/005_timeouts.pl
+11-7Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
use strict;
55
use warnings;
6+
use locale;
7+
68
use PostgreSQL::Test::Cluster;
79
use PostgreSQL::Test::Utils;
810
use Time::HiRes qw(usleep);
@@ -35,14 +37,16 @@
3537

3638
# The following query will generate a stream of SELECT 1 queries. This is done
3739
# so to exercise transaction timeout in the presence of short queries.
40+
# Note: the interval value is parsed with locale-aware strtod()
3841
$psql_session->query_until(
39-
qr/starting_bg_psql/, q(
40-
\echo starting_bg_psql
41-
SET transaction_timeout to '10ms';
42-
BEGIN;
43-
SELECT 1 \watch 0.001
44-
\q
45-
));
42+
qr/starting_bg_psql/,
43+
sprintf(
44+
q(\echo starting_bg_psql
45+
SET transaction_timeout to '10ms';
46+
BEGIN;
47+
SELECT 1 \watch %g
48+
\q
49+
), 0.001));
4650

4751
# Wait until the backend enters the timeout injection point. Will get an error
4852
# here if anything goes wrong.

0 commit comments

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