postgres.git / summary / log / commit / refs

commit    a3eb08b809a4b9e348efb0bae9c2834b71d53273
Author:   Tomas Vondra <tomas.vondra@postgresql.org>
Date:     Sun Jan 23 02:36:55 2022 +0000
First released in: 15.0, 10.20, 11.15, 12.10, 13.6, 14.2

    Correct type of front_pathkey to PathKey
    
    In sort_inner_and_outer we iterate a list of PathKey elements, but the
    variable is declared as (List *). This mistake is benign, because we
    only pass the pointer to lcons() and never dereference it.
    
    This exists since ~2004, but it's confusing. So fix and backpatch to all
    supported branches.
    
    Backpatch-through: 10
    Discussion: https://postgr.es/m/bf3a6ea1-a7d8-7211-0669-189d5c169374%40enterprisedb.com


src/backend/optimizer/path/joinpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/optimizer/path/joinpath.c b/src/backend/optimizer/path/joinpath.c index 2fb94ccdc51..cc91f566904 100644 --- a/src/backend/optimizer/path/joinpath.c +++ b/src/backend/optimizer/path/joinpath.c @@ -900,7 +900,7 @@ sort_inner_and_outer(PlannerInfo *root, foreach(l, all_pathkeys) { - List *front_pathkey = (List *) lfirst(l); + PathKey *front_pathkey = (PathKey *) lfirst(l); List *cur_mergeclauses; List *outerkeys; List *innerkeys; [parent: 0c7c94f90cd4]