Unbreak version 2 protocol case.
authorTatsuo Ishii <ishii@postgresql.org>
Thu, 11 Aug 2016 09:35:19 +0000 (18:35 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Thu, 11 Aug 2016 09:42:22 +0000 (18:42 +0900)
Commit:
https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=3cbce4eaf870e89fdd8f8a2ad8fab8d3d8aadf65

broke version 2 protocol case. In the session initiation phase,
"MAJOR" macro is used *before* session context is created.  In this
MAJOR macro returns PROTO_MAJOR_V3, which of course breaks v2 protocol
negotiation. Fix is, not to use MAJOR macro here.

pool_auth.c

index 387a98719a623d62ec8406f49fad84abf50b8001..cbdad144ee7b1e0ce7ae7a789a28b61fe1a0caf8 100644 (file)
@@ -68,7 +68,7 @@ int pool_do_auth(POOL_CONNECTION *frontend, POOL_CONNECTION_POOL *cp)
        int i;
        StartupPacket *sp;
 
-       protoMajor = MAJOR(cp);
+       protoMajor = MASTER_CONNECTION(cp)->sp->major;
 
        kind = pool_read_kind(cp);
        if (kind < 0)