Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Make connect/test1 independent of localhost IPv6.
authorNoah Misch <noah@leadboat.com>
Sat, 11 Nov 2017 22:33:02 +0000 (14:33 -0800)
committerNoah Misch <noah@leadboat.com>
Sat, 11 Nov 2017 22:33:43 +0000 (14:33 -0800)
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
src/interfaces/ecpg/test/expected/connect-test1.c
src/interfaces/ecpg/test/expected/connect-test1.stderr

index 3b478ba647202abf3197b3e9b4af831e869ea208..ba93e1d636f3d4f36337b7cfdbdd2494971dcc21 100644 (file)
@@ -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 */
index fe000302b03d3d848c971ebfc0f2bbce46fb2408..a5128600b28a98bba17491bafff19ad02aee7063 100644 (file)
@@ -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 */
index e755a0a3458eff703a7c571d1bdf197560e09563..8af57ab32c33bc6cefc061e724eb8d3ce66f377d 100644 (file)
 [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