From 1d79820b74e0c562a37c8e052cf6e6343b36bf8f Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Wed, 11 Jan 2017 16:08:21 -0800 Subject: [PATCH] Fix use of wrong constant. This could potentially lead to spuriously shared connections if the first 63 characters of a hostname are the same. --- src/backend/distributed/connection/connection_management.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/distributed/connection/connection_management.c b/src/backend/distributed/connection/connection_management.c index 22e391b4f..724a6ec39 100644 --- a/src/backend/distributed/connection/connection_management.c +++ b/src/backend/distributed/connection/connection_management.c @@ -596,7 +596,7 @@ ConnectionHashCompare(const void *a, const void *b, Size keysize) ConnectionHashKey *ca = (ConnectionHashKey *) a; ConnectionHashKey *cb = (ConnectionHashKey *) b; - if (strncmp(ca->hostname, cb->hostname, NAMEDATALEN) != 0 || + if (strncmp(ca->hostname, cb->hostname, MAX_NODE_LENGTH) != 0 || ca->port != cb->port || strncmp(ca->user, cb->user, NAMEDATALEN) != 0 || strncmp(ca->database, cb->database, NAMEDATALEN) != 0)