summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Misch2017-11-11 22:33:02 +0000
committerNoah Misch2017-11-11 22:33:41 +0000
commit65fd34f7cc6c4ab729b93bef55095c0156d7c0d4 (patch)
treeb391939863a09de6289b89e468172531965bd849
parentdfabce8827e65c3a48051526451c1b514b223ba1 (diff)
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).
-rw-r--r--src/interfaces/ecpg/test/connect/test1.pgc2
-rw-r--r--src/interfaces/ecpg/test/expected/connect-test1.c2
-rw-r--r--src/interfaces/ecpg/test/expected/connect-test1.stderr4
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