Skip to content

Commit 314762b

Browse files
author
Alexander Korotkov
committed
Evaluate constant expressions before selecting section for UPDATE/DELETE.
1 parent 44e09c4 commit 314762b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

contrib/pg_pathman/pg_pathman.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "nodes/pg_list.h"
1717
#include "nodes/relation.h"
1818
#include "nodes/primnodes.h"
19+
#include "optimizer/clauses.h"
1920
#include "optimizer/paths.h"
2021
#include "optimizer/pathnode.h"
2122
#include "optimizer/planner.h"
@@ -299,7 +300,7 @@ handle_modification_query(Query *parse)
299300

300301
/* Parse syntax tree and extract partition ranges */
301302
ranges = list_make1_int(make_irange(0, prel->children_count - 1, false));
302-
wrap = walk_expr_tree( (Expr *) parse->jointree->quals, prel);
303+
wrap = walk_expr_tree((Expr *) eval_const_expressions(NULL, parse->jointree->quals), prel);
303304
wrappers = lappend(wrappers, wrap);
304305
ranges = irange_list_intersect(ranges, wrap->rangeset);
305306

0 commit comments

Comments
 (0)