postgres.git / summary / log / commit / refs

commit    4aa02d0729f01e6f381a2ffbf052a0d54dcbdb82
Author:   Magnus Hagander <magnus@hagander.net>
Date:     Fri Jul 03 13:09:06 2020 +0000
First released in: 14.0, 9.5.23, 9.6.19, 10.14, 11.9, 12.4, 13.0

    Fix temporary tablespaces for shared filesets
    
    A likely copy/paste error in 98e8b480532 from  back in 2004 would
    cause temp tablespace to be reset to InvalidOid if temp_tablespaces
    was set to the same value as the primary tablespace in the database.
    This would cause shared filesets (such as for parallel hash joins)
    to ignore them, putting the temporary files in the default tablespace
    instead of the configured one. The bug is in the old code, but it
    appears to have been exposed only once we had shared filesets.
    
    Reviewed-By: Daniel Gustafsson
    Discussion: https://postgr.es/m/CABUevExg5YEsOvqMxrjoNvb3ApVyH+9jggWGKwTDFyFCVWczGQ@mail.gmail.com
    Backpatch-through: 9.5


src/backend/commands/tablespace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c index 946777f48b2..3105efe0403 100644 --- a/src/backend/commands/tablespace.c +++ b/src/backend/commands/tablespace.c @@ -1354,7 +1354,7 @@ PrepareTempTablespaces(void) */ if (curoid == MyDatabaseTableSpace) { - tblSpcs[numSpcs++] = InvalidOid; + tblSpcs[numSpcs++] = curoid; continue; } [parent: 81b244e78b63]