]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix copy-paste error in hash_record_extended() REL_14_STABLE github/REL_14_STABLE
authorMichael Paquier <michael@paquier.xyz>
Wed, 3 Jun 2026 03:47:34 +0000 (12:47 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 3 Jun 2026 03:47:34 +0000 (12:47 +0900)
The code failed to initialize the second isnull argument passed to
FunctionCallInvoke().  This is harmless for existing in-core extended
hash support functions, since FunctionCallInvoke() does not use the
value (note that all the in-core extended hash functions are strict),
examining only the argument values.  However, extension-provided
extended hash functions could be affected if they inspect
PG_ARGISNULL(1).

Oversight in 01e658fa74cb.

Author: Man Zeng <zengman@halodbtech.com>
Discussion: https://postgr.es/m/tencent_7818173C01E01836109848C3@qq.com
Backpatch-through: 14

src/backend/utils/adt/rowtypes.c

index 1a71fdbc33f57749b8c5492a41f84ff1271a74de..469ed3df8e6258457ce7869816659dde5dae53bc 100644 (file)
@@ -1995,7 +1995,7 @@ hash_record_extended(PG_FUNCTION_ARGS)
                        locfcinfo->args[0].value = values[i];
                        locfcinfo->args[0].isnull = false;
                        locfcinfo->args[1].value = Int64GetDatum(seed);
-                       locfcinfo->args[0].isnull = false;
+                       locfcinfo->args[1].isnull = false;
                        element_hash = DatumGetUInt64(FunctionCallInvoke(locfcinfo));
 
                        /* We don't expect hash support functions to return null */