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

Commit45f5270

Browse files
committed
Make PG_TEST_USE_UNIX_SOCKETS work for tap tests on windows.
We need to replace windows-style \ path separators with / when putting socketdirectories either in postgresql.conf or libpq connection strings, otherwisethey are interpreted as escapes.Author: Andres Freund <andres@anarazel.de>Reviewed-By: Peter Eisentraut <peter.eisentraut@enterprisedb.com>Discussion:https://postgr.es/m/4da250a5-4222-1522-f14d-8a72bcf7e38e@enterprisedb.com
1 parentfa0e03c commit45f5270

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

‎src/bin/pg_ctl/t/001_start_stop.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
if ($use_unix_sockets)
3636
{
3737
print$conf"listen_addresses = ''\n";
38+
$tempdir_short =~s!\\!/!gif$PostgreSQL::Test::Utils::windows_os;
3839
print$conf"unix_socket_directories = '$tempdir_short'\n";
3940
}
4041
else

‎src/test/perl/PostgreSQL/Test/Cluster.pm

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,18 @@ INIT
119119
$use_tcp = !$PostgreSQL::Test::Utils::use_unix_sockets;
120120
$test_localhost ="127.0.0.1";
121121
$last_host_assigned = 1;
122-
$test_pghost =$use_tcp ?$test_localhost : PostgreSQL::Test::Utils::tempdir_short;
122+
if ($use_tcp)
123+
{
124+
$test_pghost =$test_localhost;
125+
}
126+
else
127+
{
128+
# On windows, replace windows-style \ path separators with / when
129+
# putting socket directories either in postgresql.conf or libpq
130+
# connection strings, otherwise they are interpreted as escapes.
131+
$test_pghost = PostgreSQL::Test::Utils::tempdir_short;
132+
$test_pghost =~s!\\!/!gif$PostgreSQL::Test::Utils::windows_os;
133+
}
123134
$ENV{PGHOST} =$test_pghost;
124135
$ENV{PGDATABASE} ='postgres';
125136

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp