postgres.git / summary / log / commit / refs
commit 65fd34f7cc6c4ab729b93bef55095c0156d7c0d4
Author: Noah Misch <noah@leadboat.com>
Date: Sat Nov 11 22:33:02 2017 +0000
First released in: 11.0, 9.3.21, 9.4.16, 9.5.11, 9.6.7, 10.2
Make connect/test1 independent of localhost IPv6.
Since commit 868898739a8da9ab74c105b8349b7b5c711f265a, it has assumed
"localhost" resolves to both ::1 and 127.0.0.1. We gain nothing from
that assumption, and it does not hold in a default installation of Red
Hat Enterprise Linux 5. Back-patch to 9.3 (all supported versions).
src/interfaces/ecpg/test/connect/test1.pgc | 2 +-
src/interfaces/ecpg/test/expected/connect-test1.c | 2 +-
src/interfaces/ecpg/test/expected/connect-test1.stderr | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/interfaces/ecpg/test/connect/test1.pgc b/src/interfaces/ecpg/test/connect/test1.pgc
index 3b478ba6472..ba93e1d636f 100644
--- a/src/interfaces/ecpg/test/connect/test1.pgc
+++ b/src/interfaces/ecpg/test/connect/test1.pgc
@@ -54,7 +54,7 @@ exec sql end declare section;
exec sql disconnect;
/* wrong port */
- exec sql connect to tcp:postgresql://localhost:20/connectdb user connectuser identified by connectpw;
+ exec sql connect to tcp:postgresql://127.0.0.1:20/connectdb user connectuser identified by connectpw;
/* no disconnect necessary */
/* wrong password */
diff --git a/src/interfaces/ecpg/test/expected/connect-test1.c b/src/interfaces/ecpg/test/expected/connect-test1.c
index fe000302b03..a5128600b28 100644
--- a/src/interfaces/ecpg/test/expected/connect-test1.c
+++ b/src/interfaces/ecpg/test/expected/connect-test1.c
@@ -109,7 +109,7 @@ main(void)
/* wrong port */
- { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:20/connectdb" , "connectuser" , "connectpw" , NULL, 0); }
+ { ECPGconnect(__LINE__, 0, "tcp:postgresql://127.0.0.1:20/connectdb" , "connectuser" , "connectpw" , NULL, 0); }
#line 57 "test1.pgc"
/* no disconnect necessary */
diff --git a/src/interfaces/ecpg/test/expected/connect-test1.stderr b/src/interfaces/ecpg/test/expected/connect-test1.stderr
index 467cebda01d..cda03d333eb 100644
--- a/src/interfaces/ecpg/test/expected/connect-test1.stderr
+++ b/src/interfaces/ecpg/test/expected/connect-test1.stderr
@@ -49,10 +49,10 @@
[NO_PID]: sqlca: code: -402, state: 08001
[NO_PID]: raising sqlcode -220 on line 54: connection "CURRENT" does not exist on line 54
[NO_PID]: sqlca: code: -220, state: 08003
-[NO_PID]: ECPGconnect: opening database connectdb on localhost port <REGRESSION_PORT> for user connectuser
+[NO_PID]: ECPGconnect: opening database connectdb on 127.0.0.1 port <REGRESSION_PORT> for user connectuser
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: could not open database: could not connect to server: Connection refused
- Is the server running on host "localhost" (127.0.0.1) and accepting
+ Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 20?
[NO_PID]: sqlca: code: 0, state: 00000
[parent: dfabce8827e6]