mirror of
https://github.com/postgres/postgres.git
synced 2026-10-23 13:29:09 +03:00
contain_context_dependent_node_walker() reports a CaseTestExpr as context-dependent unless it sits under a simple CaseExpr or the elemexpr of an ArrayCoerceExpr. A JsonConstructorExpr whose RETURNING type requires a coercion also carries a CaseTestExpr placeholder in that coercion, so any SQL function called with such a constructor as an argument was refused inlining. Teach the walker that a CaseTestExpr is expected within the coercion of a JsonConstructorExpr, the same way it already handles the elemexpr of an ArrayCoerceExpr. This is safe now that eval_const_expressions no longer lets an enclosing simple CASE clobber that placeholder. Author: Richard Guo <guofenglinux@gmail.com> Discussion: https://postgr.es/m/CAMbWs48A=VCFbteTkuCoknO1_0-Cu0aMBT0M07dm7vj1QyixDg@mail.gmail.com Backpatch-through: 19