Fix failing -D HASH_STATISTICS builds
authorDavid Rowley <[email protected]>
Fri, 15 Aug 2025 05:23:45 +0000 (17:23 +1200)
committerDavid Rowley <[email protected]>
Fri, 15 Aug 2025 05:23:45 +0000 (17:23 +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 81da03629f0d2b584f4c318a7cab6addf43c073e..30755e6b6786e28ac67f915a71e4ac73098c7629 100644 (file)
@@ -1174,6 +1174,8 @@ hash_update_hash_key(HTAB *hashp,
    HashCompareFunc match;
 
 #ifdef HASH_STATISTICS
+   HASHHDR    *hctl = hashp->hctl;
+
    hash_accesses++;
    hctl->accesses++;
 #endif