diff options
author | Tom Lane | 2021-06-06 19:46:58 +0000 |
---|---|---|
committer | Tom Lane | 2021-06-06 19:46:58 +0000 |
commit | a65e9f3f1405b786673feec131879843432bf9a6 (patch) | |
tree | f8db13be4c04653dc5d433466b0255c628ac08f9 | |
parent | d57ecebd128cdf2f4844a2ea4d35ff28d7d69be8 (diff) |
Fix inconsistent equalfuncs.c behavior for FuncCall.funcformat.
Other equalfuncs.c checks on CoercionForm fields use
COMPARE_COERCIONFORM_FIELD (which makes them no-ops),
but commit 40c24bfef neglected to make _equalFuncCall
do likewise. Fix that.
This is only strictly correct if FuncCall.funcformat has
no semantic effect, instead just determining ruleutils.c
display formatting. 40c24bfef added a couple of checks
in parse analysis that could break that rule; but on closer
inspection, they're redundant, so just take them out again.
Per report from Noah Misch.
Discussion: https://postgr.es/m/[email protected]
-rw-r--r-- | src/backend/nodes/equalfuncs.c | 2 | ||||
-rw-r--r-- | src/backend/parser/parse_clause.c | 1 | ||||
-rw-r--r-- | src/backend/parser/parse_func.c | 1 |
3 files changed, 1 insertions, 3 deletions
diff --git a/src/backend/nodes/equalfuncs.c b/src/backend/nodes/equalfuncs.c index 47546739ed..3033c1934c 100644 --- a/src/backend/nodes/equalfuncs.c +++ b/src/backend/nodes/equalfuncs.c @@ -2420,7 +2420,7 @@ _equalFuncCall(const FuncCall *a, const FuncCall *b) COMPARE_SCALAR_FIELD(agg_star); COMPARE_SCALAR_FIELD(agg_distinct); COMPARE_SCALAR_FIELD(func_variadic); - COMPARE_SCALAR_FIELD(funcformat); + COMPARE_COERCIONFORM_FIELD(funcformat); COMPARE_LOCATION_FIELD(location); return true; diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c index 89d95d3e94..71c360bea5 100644 --- a/src/backend/parser/parse_clause.c +++ b/src/backend/parser/parse_clause.c @@ -543,7 +543,6 @@ transformRangeFunction(ParseState *pstate, RangeFunction *r) !fc->agg_star && !fc->agg_distinct && !fc->func_variadic && - fc->funcformat == COERCE_EXPLICIT_CALL && coldeflist == NIL) { ListCell *lc; diff --git a/src/backend/parser/parse_func.c b/src/backend/parser/parse_func.c index baac089d68..fb0ba58ff7 100644 --- a/src/backend/parser/parse_func.c +++ b/src/backend/parser/parse_func.c @@ -222,7 +222,6 @@ ParseFuncOrColumn(ParseState *pstate, List *funcname, List *fargs, agg_order == NIL && agg_filter == NULL && !agg_star && !agg_distinct && over == NULL && !func_variadic && argnames == NIL && - funcformat == COERCE_EXPLICIT_CALL && list_length(funcname) == 1 && (actual_arg_types[0] == RECORDOID || ISCOMPLEX(actual_arg_types[0]))); |