8000 Make connect/test1 independent of localhost IPv6. · postgrespro/postgres@34baf8a · GitHub
[go: up one dir, main page]

Skip to content
  • Commit 34baf8a

    Browse files
    committed
    Make connect/test1 independent of localhost IPv6.
    Since commit 8688987, 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).
    1 parent 4b865ae commit 34baf8a

    File tree

    3 files changed

    +4
    -7
    lines changed

    3 files changed

    +4
    -7
    lines changed

    src/interfaces/ecpg/test/connect/test1.pgc

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -54,7 +54,7 @@ exec sql end declare section;
    5454
    exec sql disconnect;
    5555

    5656
    /* wrong port */
    57-
    exec sql connect to tcp:postgresql://localhost:20/ecpg2_regression user regress_ecpg_user1 identified by connectpw;
    57+
    exec sql connect to tcp:postgresql://127.0.0.1:20/ecpg2_regression user regress_ecpg_user1 identified by connectpw;
    5858
    /* no disconnect necessary */
    5959

    6060
    /* wrong password */

    src/interfaces/ecpg/test/expected/connect-test1.c

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -109,7 +109,7 @@ main(void)
    109109

    110110

    111111
    /* wrong port */
    112-
    { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:20/ecpg2_regression" , "regress_ecpg_user1" , "connectpw" , NULL, 0); }
    112+
    { ECPGconnect(__LINE__, 0, "tcp:postgresql://127.0.0.1:20/ecpg2_regression" , "regress_ecpg_user1" , "connectpw" , NULL, 0); }
    113113
    #line 57 "test1.pgc"
    114114

    115115
    /* no disconnect necessary */

    src/interfaces/ecpg/test/expected/connect-test1.stderr

    Lines changed: 2 additions & 5 deletions
    Original file line numberDiff line numberDiff line change
    @@ -63,13 +63,10 @@
    6363
    [NO_PID]: sqlca: code: -402, state: 08001
    6464
    [NO_PID]: raising sqlcode -220 on line 54: connection "CURRENT" does not exist on line 54
    6565
    [NO_PID]: sqlca: code: -220, state: 08003
    66-
    [NO_PID]: ECPGconnect: opening database ecpg2_regression on localhost port <REGRESSION_PORT> for user regress_ecpg_user1
    66+
    [NO_PID]: ECPGconnect: opening database ecpg2_regression on 127.0.0.1 port <REGRESSION_PORT> for user regress_ecpg_user1
    6767
    [NO_PID]: sqlca: code: 0, state: 00000
    6868
    [NO_PID]: ECPGconnect: could not open database: could not connect to server: Connection refused
    69-
    Is the server running on host "localhost" (::1) and accepting
    70-
    TCP/IP connections on port 20?
    71-
    could not connect to server: Connection refused
    72-
    Is the server running on host "localhost" (127.0.0.1) and accepting
    69+
    Is the server running on host "127.0.0.1" and accepting
    7370
    TCP/IP connections on port 20?
    7471

    7572
    [NO_PID]: sqlca: code: 0, state: 00000

    0 commit comments

    Comments
     (0)
    0