classCallChecks
final class CallChecks
Reports the calls every routine, or the resolved kind of function, rejects.
Rule: PG-CALL-CHECKS-001. Whatever the routine, a positional argument cannot follow a named one and a parameter name cannot be used twice. A plain function takes no *, DISTINCT, ordering, WITHIN GROUP, FILTER or OVER. An aggregate that is not an ordered-set aggregate takes no WITHIN GROUP, and a parameterless aggregate is called with *; with OVER, it takes no DISTINCT and no ordering. A window function requires OVER and takes no WITHIN GROUP, DISTINCT, ordering or FILTER. Parameter names are compared exactly, as decoded. Source: ParseFuncOrColumn in src/backend/parser/parse_func.c of PostgreSQL 17, https://www.postgresql.org/docs/17/sql-syntax-calling-funcs.html, https://www.postgresql.org/docs/17/sql-expressions.html#SYNTAX-AGGREGATES. Termination: one pass over the arguments. Status: Implemented.
Methods§
public function arguments(Derivation $derivation, list<Argument> $arguments): voidReports the argument naming mistakes of a call.
Parameters
$derivation | Derivation | |
$arguments | list<Argument> |
Test cases 1
Called from 2
- method-call SqlSemantics\Platform\PostgreSql\Rules\Invocation\CallTyping::call() packages/sql-semantics-postgres/src/Rules/Invocation/CallTyping.php:54
- method-call SqlSemantics\Platform\PostgreSql\Statement\Invocation\Syntax\KeywordCall::deriveScalar() packages/sql-semantics-postgres/src/Statement/Invocation/Syntax/KeywordCall.php:78
Calls 5
- method-call Derivation::report() line 48
- new ArgumentProblem line 48
- class-const ArgumentProblemKind::PositionalAfterNamed() line 48
- function-call
in_arrayline 52 - class-const ArgumentProblemKind::RepeatedName() line 53
public function misuse(Derivation $derivation, FunctionCall $call, string $kind): ?CallMisuseReports the clauses the kind of the resolved function does not accept and answers the first, or null when there is none.
Parameters
$derivation | Derivation | |
$call | FunctionCall | |
$kind | string | The kind of the function: s plain, a aggregate, w window |
Returns
Test cases 3
Called from 1
Calls 16
- class-const CallMisuseKind::StarOnPlainFunction() line 71
- class-const CallMisuseKind::DistinctOnPlainFunction() line 71
- class-const CallMisuseKind::WithinGroupOnPlainFunction() line 72
- class-const CallMisuseKind::OrderOnPlainFunction() line 72
- class-const CallMisuseKind::FilterOnPlainFunction() line 73
- class-const CallMisuseKind::OverOnPlainFunction() line 73
- class-const CallMisuseKind::WithinGroupOnPlainAggregate() line 76
- class-const CallMisuseKind::ParameterlessWithoutStar() line 76
- class-const CallMisuseKind::DistinctInWindow() line 77
- class-const CallMisuseKind::OrderInWindow() line 77
- class-const CallMisuseKind::WindowWithoutOver() line 80
- class-const CallMisuseKind::WithinGroupOnWindow() line 80
- class-const CallMisuseKind::FilterOnWindow() line 81
- new CallMisuse line 87
- new Name line 87
- method-call Derivation::report() line 88
Test cases 4§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Relations§
Instantiated in 2
- new SqlSemantics\Platform\PostgreSql\Rules\Invocation\CallTyping::call() packages/sql-semantics-postgres/src/Rules/Invocation/CallTyping.php:53
- new SqlSemantics\Platform\PostgreSql\Statement\Invocation\Syntax\KeywordCall::deriveScalar() packages/sql-semantics-postgres/src/Statement/Invocation/Syntax/KeywordCall.php:78
Method calls 3
- method-call SqlSemantics\Platform\PostgreSql\Rules\Invocation\CallTyping::call() packages/sql-semantics-postgres/src/Rules/Invocation/CallTyping.php:54
- method-call SqlSemantics\Platform\PostgreSql\Rules\Invocation\CallTyping::call() packages/sql-semantics-postgres/src/Rules/Invocation/CallTyping.php:80
- method-call SqlSemantics\Platform\PostgreSql\Statement\Invocation\Syntax\KeywordCall::deriveScalar() packages/sql-semantics-postgres/src/Statement/Invocation/Syntax/KeywordCall.php:78