Fix failing -D HASH_STATISTICS builds
authorDavid Rowley <[email protected]>
Fri, 15 Aug 2025 05:24:21 +0000 (17:24 +1200)
committerDavid Rowley <[email protected]>
Fri, 15 Aug 2025 05:24:21 +0000 (17:24 +1200)
This seems to have been broken for a few years by cc5ef90ed.

Author: Hayato Kuroda (Fujitsu) <[email protected]>
Reviewed-by: David Rowley <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/OSCPR01MB14966E11EEFB37D7857FCEDB7F535A@OSCPR01MB14966.jpnprd01.prod.outlook.com
Backpatch-through: 17

src/backend/utils/hash/dynahash.c

index 1ad155d446e51d4eae551370228dad202cc54852..bd0525ecdc78f73b4025c94c9da9d44b66b16b1a 100644 (file)
@@ -1158,6 +1158,8 @@ hash_update_hash_key(HTAB *hashp,
    HashCompareFunc match;
 
 #ifdef HASH_STATISTICS
+   HASHHDR    *hctl = hashp->hctl;
+
    hash_accesses++;
    hctl->accesses++;
 #endif