Adds HASH_STRINGS flag to ruleutils_14.c

Relevant PG commit:
b3817f5f774663d55931dd4fab9c5a94a15ae7ab
pull/5209/head
Halil Ozan Akgul 2021-08-16 15:07:05 +03:00 committed by Sait Talha Nisanci
parent e72bd0c1a1
commit 71691ecf06
1 changed files with 2 additions and 2 deletions

View File

@ -540,14 +540,14 @@ set_rtable_names(deparse_namespace *dpns, List *parent_namespaces,
* We use a hash table to hold known names, so that this process is O(N) * We use a hash table to hold known names, so that this process is O(N)
* not O(N^2) for N names. * not O(N^2) for N names.
*/ */
MemSet(&hash_ctl, 0, sizeof(hash_ctl));
hash_ctl.keysize = NAMEDATALEN; hash_ctl.keysize = NAMEDATALEN;
hash_ctl.entrysize = sizeof(NameHashEntry); hash_ctl.entrysize = sizeof(NameHashEntry);
hash_ctl.hcxt = CurrentMemoryContext; hash_ctl.hcxt = CurrentMemoryContext;
names_hash = hash_create("set_rtable_names names", names_hash = hash_create("set_rtable_names names",
list_length(dpns->rtable), list_length(dpns->rtable),
&hash_ctl, &hash_ctl,
HASH_ELEM | HASH_CONTEXT); HASH_ELEM | HASH_STRINGS | HASH_CONTEXT);
/* Preload the hash table with names appearing in parent_namespaces */ /* Preload the hash table with names appearing in parent_namespaces */
foreach(lc, parent_namespaces) foreach(lc, parent_namespaces)
{ {