postgres.git / summary / log / commit / refs

commit    203e238bbe8a2b5357157ae2e4b0c7f7a6b5b94d
Author:   Michael Paquier <michael@paquier.xyz>
Date:     Wed Jun 03 03:47:28 2026 +0000
First released in: 14.24, 15.19, 16.15, 17.11, 18.6

    Fix copy-paste error in hash_record_extended()
    
    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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/utils/adt/rowtypes.c b/src/backend/utils/adt/rowtypes.c index 0214c23a1d4..a4d32f8013b 100644 --- a/src/backend/utils/adt/rowtypes.c +++ b/src/backend/utils/adt/rowtypes.c @@ -2012,7 +2012,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 */ [parent: c3f1db2b8822]