Skip to content

Commit 481a998

Browse files
committed
Fix breakage in AlterFunction().
An ALTER FUNCTION command that tried to update both the function's proparallel property and its proconfig list failed to do the former, because it stored the new proparallel value into a tuple that was no longer the interesting one. Carelessness in 7aea8e4. (I did not bother with a regression test, because the only likely future breakage would be for someone to ignore the comment I added and add some other field update after the heap_modify_tuple step. A test using existing function properties could not catch that.) Per report from Bryn Llewellyn. Back-patch to all supported branches. Discussion: https://postgr.es/m/8AC9A37F-99BD-446F-A2F7-B89AD0022774@yugabyte.com
1 parent 59348fb commit 481a998

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/commands/functioncmds.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,6 +1352,8 @@ AlterFunction(ParseState *pstate, AlterFunctionStmt *stmt)
13521352

13531353
procForm->prosupport = newsupport;
13541354
}
1355+
if (parallel_item)
1356+
procForm->proparallel = interpret_func_parallel(parallel_item);
13551357
if (set_items)
13561358
{
13571359
Datum datum;
@@ -1386,8 +1388,7 @@ AlterFunction(ParseState *pstate, AlterFunctionStmt *stmt)
13861388
tup = heap_modify_tuple(tup, RelationGetDescr(rel),
13871389
repl_val, repl_null, repl_repl);
13881390
}
1389-
if (parallel_item)
1390-
procForm->proparallel = interpret_func_parallel(parallel_item);
1391+
/* DO NOT put more touches of procForm below here; it's now dangling. */
13911392

13921393
/* Do the update */
13931394
CatalogTupleUpdate(rel, &tup->t_self, tup);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy