Skip to content

Commit 43fd918

Browse files
committed
Heal segfault in handle_modification_query.
To encounter this, you need to parse utility query after entering planning.
1 parent b530684 commit 43fd918

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/pg_pathman.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1965,6 +1965,7 @@ make_inh_translation_list(Relation oldrelation, Relation newrelation,
19651965
/*
19661966
* set_append_rel_pathlist
19671967
* Build access paths for an "append relation"
1968+
* Similar to PG function with the same name.
19681969
*
19691970
* NOTE: this function is 'public' (used in hooks.c)
19701971
*/

src/planner_tree_modification.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ handle_modification_query(Query *parse, transform_query_cxt *context)
516516
{
517517
RangeTblEntry *rte;
518518
Oid child;
519-
Node *quals = parse->jointree->quals;
519+
Node *quals;
520520
Index result_rti = parse->resultRelation;
521521
ParamListInfo params = context->query_params;
522522

@@ -525,6 +525,8 @@ handle_modification_query(Query *parse, transform_query_cxt *context)
525525
parse->commandType != CMD_DELETE))
526526
return;
527527

528+
/* can't set earlier because CMD_UTILITY doesn't have jointree */
529+
quals = parse->jointree->quals;
528530
rte = rt_fetch(result_rti, parse->rtable);
529531

530532
/* Exit if it's ONLY table */

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