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

Commit6050622

Browse files
committed
Use locale-aware value for \watch in 005_timeouts.pl
Reported-by: Alexander Lakhin
1 parent196eeb6 commit6050622

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

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

Lines 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::HiResqw(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)

[8]ページ先頭

©2009-2025 Movatter.jp