final class FunctionCall
    implements Scalar
    uses Snapshot
Public API: explicitly declared with @visibility public.

A call written as name(...) or db.name(...): a native function reached by name, a loadable function or a stored function.

The server mirrors this as PTI_function_call_generic_ident_sys and PTI_function_call_generic_2d. Only the unqualified form takes argument aliases. The facts follow MYSQL-ROUTINE-CALL-001. The name is written against its parenthesis, because a name followed by a space is a column unless IGNORE_SPACE is set. Source: https://dev.mysql.com/doc/refman/8.4/en/function-resolution.html. Status: Implemented.

Typing a call of a native function reached by namedoctest
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze("SELECT concat('a', 'b')");
    $query->field(0)->type->descriptor->name() // => 'VARCHAR'
Depending on the signature of a stored functiondoctest
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT db.score(1)');
    $query->field(0)->type->missing[0]->describe() // => 'the signature of routine score'
Refusing an alias on a qualified calldoctest
new \SqlSemantics\Platform\MySql\Statement\Call\FunctionCall(new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('f'), [new \SqlSemantics\Platform\MySql\Statement\Call\CallArgument(new \SqlSemantics\Platform\MySql\Statement\Literal\NullLiteral(), new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('x'))], new \SqlSemantics\Platform\MySql\Model\Statement\Identifier\Name('db')) // throws \SqlSemantics\Platform\MySql\Model\Diagnostic\InvalidConstruction

Properties§

public list<CallArgument> $arguments
public Name $name
public Name|null $schema = null

Methods§

public function __construct(
    public Name $name,
    list<CallArgument> $arguments = [],
    public Name|null $schema = null,
)

Parameters

$nameNameThe function name
$argumentslist<CallArgument>The arguments in order
$schemaName|nullThe database of a qualified call
Calls 4
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFact

Derives the arguments and the result of the called function.

Parameters

$derivationDerivation
$environmentEnvironment

Returns

Calls 4
public function render(Output $out): void

Writes the call with the name against its parenthesis.

Parameters

$outOutput
Test cases 2
Calls 3

Test cases 11§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 5
Other tests reaching this symbol 6

Relations§

Instantiated in 2
Method calls 2
Type checks 1
Type declarations 1