Skip to content

Commit 1571bc0

Browse files
committed
Fix incorrect strictness test for ArrayCoerceExpr expressions.
The recursion in contain_nonstrict_functions_walker() was done wrong, causing the strictness check to be bypassed for a parse node that is the immediate input of an ArrayCoerceExpr node. This could allow, for example, incorrect decisions about whether a strict SQL function can be inlined. I didn't add a regression test, because (a) the bug is so narrow and (b) I couldn't think of a test case that wasn't dependent on a large number of other behaviors, to the point where it would likely soon rot to the point of not testing what it was intended to. I broke this in commit c12d570, so back-patch to v11. Discussion: https://postgr.es/m/27571.1550617881@sss.pgh.pa.us
1 parent 5721b9b commit 1571bc0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/backend/optimizer/util/clauses.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,9 +1179,8 @@ contain_nonstrict_functions_walker(Node *node, void *context)
11791179
* the per-element expression is; so we should ignore elemexpr and
11801180
* recurse only into the arg.
11811181
*/
1182-
return expression_tree_walker((Node *) ((ArrayCoerceExpr *) node)->arg,
1183-
contain_nonstrict_functions_walker,
1184-
context);
1182+
return contain_nonstrict_functions_walker((Node *) ((ArrayCoerceExpr *) node)->arg,
1183+
context);
11851184
}
11861185
if (IsA(node, CaseExpr))
11871186
return true;

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