Use HASH_STRINGS explicitly in hash functions

Postgres expects to set the HASH_STRINGS explicitly in case of the
default behaivor for string hash function.

Postgres Commit
b3817f5f774663d55931dd4fab9c5a94a15ae7ab
pull/5209/head
Sait Talha Nisanci 2021-08-18 15:13:57 +03:00
parent 5930378f61
commit 96833e2b8f
2 changed files with 8 additions and 2 deletions

View File

@ -132,7 +132,7 @@ columnar_init_write_state(Relation relation, TupleDesc tupdesc,
"Column Store Write State Management Context",
ALLOCSET_DEFAULT_SIZES);
HASHCTL info;
uint32 hashFlags = (HASH_ELEM | HASH_CONTEXT);
uint32 hashFlags = (HASH_ELEM | HASH_STRINGS | HASH_CONTEXT);
memset(&info, 0, sizeof(info));
info.keysize = sizeof(Oid);
info.entrysize = sizeof(WriteStateMapEntry);

View File

@ -135,7 +135,13 @@ ListToHashSet(List *itemList, Size keySize, bool isStringList)
info.entrysize = keySize;
info.hcxt = CurrentMemoryContext;
if (!isStringList)
if (isStringList)
{
#if PG_VERSION_NUM >= PG_VERSION_14
flags |= HASH_STRINGS;
#endif
}
else
{
flags |= HASH_BLOBS;
}