Correctly specify HASH_BLOBS while using nodeOid as a key for pooler hash
authorPavan Deolasee <[email protected]>
Mon, 28 Mar 2016 11:34:53 +0000 (17:04 +0530)
committerPavan Deolasee <[email protected]>
Mon, 28 Mar 2016 11:34:53 +0000 (17:04 +0530)
tables.

Without this, we were incorrectly using the default string copy/compare
functions, thus later breaking things.

src/backend/pgxc/pool/poolmgr.c

index 0811e378fa5890592aa47920332497bb91a44193..c73e1982ec962939deb5ce2af0b66b52e51b2e28 100644 (file)
@@ -1781,7 +1781,6 @@ create_database_pool(const char *database, const char *user_name, const char *pg
        MemoryContext   dbcontext;
        DatabasePool   *databasePool;
        HASHCTL                 hinfo;
-       int                             hflags;
 
        elog(DEBUG1, "Creating a connection pool for database %s, user %s,"
                        " with pgoptions %s", database, user_name, pgoptions);
@@ -1828,17 +1827,14 @@ create_database_pool(const char *database, const char *user_name, const char *pg
 
        /* Init node hashtable */
        MemSet(&hinfo, 0, sizeof(hinfo));
-       hflags = 0;
 
        hinfo.keysize = sizeof(Oid);
        hinfo.entrysize = sizeof(PGXCNodePool);
-       hflags |= HASH_ELEM;
-
        hinfo.hcxt = dbcontext;
-       hflags |= HASH_CONTEXT;
 
        databasePool->nodePools = hash_create("Node Pool", MaxDataNodes + MaxCoords,
-                                                                                 &hinfo, hflags);
+                                                                                 &hinfo,
+                                                                                 HASH_ELEM | HASH_CONTEXT | HASH_BLOBS);
 
        MemoryContextSwitchTo(oldcontext);