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
talha_pg14_support
Sait Talha Nisanci 2021-08-18 15:13:57 +03:00
parent 5161f4f0fa
commit e92c915842
2 changed files with 3 additions and 1 deletions

View File

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

View File

@ -138,6 +138,8 @@ ListToHashSet(List *itemList, Size keySize, bool isStringList)
if (!isStringList) if (!isStringList)
{ {
flags |= HASH_BLOBS; flags |= HASH_BLOBS;
}else {
flags |= HASH_STRINGS;
} }
HTAB *itemSet = hash_create("ListToHashSet", capacity, &info, flags); HTAB *itemSet = hash_create("ListToHashSet", capacity, &info, flags);