mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
Fix oversight in CALL argument handling, and do some minor cleanup.
CALL statements cannot support sub-SELECTs in the arguments of the called procedure, since they just use ExecEvalExpr to evaluate such arguments. Teach transformSubLink() to reject the case, as it already does for other contexts in which subqueries are not supported. In passing, s/EXPR_KIND_CALL/EXPR_KIND_CALL_ARGUMENT/ to make that enum symbol line up more closely with the phrasing of the error messages it is associated with. And fix someone's weak grasp of English grammar in the preceding EXPR_KIND_PARTITION_EXPRESSION addition. Also update an incorrect comment in resolve_unique_index_expr (possibly it was correct when written, but nowadays transformExpr definitely does reject SRFs here). Per report from Pavel Stehule --- but this resolves only one of the bugs he mentions. Discussion: https://postgr.es/m/CAFj8pRDxOwPPzpA8i+AQeDQFj7bhVw-dR2==rfWZ3zMGkm568Q@mail.gmail.com
This commit is contained in:
@ -3106,12 +3106,11 @@ resolve_unique_index_expr(ParseState *pstate, InferClause *infer,
|
||||
}
|
||||
|
||||
/*
|
||||
* transformExpr() should have already rejected subqueries,
|
||||
* aggregates, and window functions, based on the EXPR_KIND_ for an
|
||||
* index expression. Expressions returning sets won't have been
|
||||
* rejected, but don't bother doing so here; there should be no
|
||||
* available expression unique index to match any such expression
|
||||
* against anyway.
|
||||
* transformExpr() will reject subqueries, aggregates, window
|
||||
* functions, and SRFs, based on being passed
|
||||
* EXPR_KIND_INDEX_EXPRESSION. So we needn't worry about those
|
||||
* further ... not that they would match any available index
|
||||
* expression anyway.
|
||||
*/
|
||||
pInfer->expr = transformExpr(pstate, parse, EXPR_KIND_INDEX_EXPRESSION);
|
||||
|
||||
|
Reference in New Issue
Block a user