• Robert Haas's avatar
    Fix problems with ParamListInfo serialization mechanism. · 1efc7e53
    Robert Haas authored
    Commit d1b7c1ff introduced a mechanism
    for serializing a ParamListInfo structure to be passed to a parallel
    worker.  However, this mechanism failed to handle external expanded
    values, as pointed out by Noah Misch.  Repair.
    
    Moreover, plpgsql_param_fetch requires adjustment because the
    serialization mechanism needs it to skip evaluating unused parameters
    just as we would do when it is called from copyParamList, but params
    == estate->paramLI in that case.  To fix, make the bms_is_member test
    in that function unconditional.
    
    Finally, have setup_param_list set a new ParamListInfo field,
    paramMask, to the parameters actually used in the expression, so that
    we don't try to fetch those that are not needed when serializing a
    parameter list.  This isn't necessary for correctness, but it makes
    the performance of the parallel executor code comparable to what we
    do for cases involving cursors.
    
    Design suggestions and extensive review by Noah Misch.  Patch by me.
    1efc7e53
functions.c 55.9 KB