Fix use of wrong constant.

This could potentially lead to spuriously shared connections if the
first 63 characters of a hostname are the same.
pull/1120/head
Andres Freund 2017-01-11 16:08:21 -08:00
parent 4b1d37b7be
commit 1d79820b74
1 changed files with 1 additions and 1 deletions

View File

@ -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)