final class DynamicPrivilege
    implements Grantable
    uses Snapshot
Public API: explicitly declared with @visibility public.

A privilege the server or a component registers at runtime, such as BACKUP_ADMIN (8.0+).

Mirrors PT_role_or_dynamic_privilege read as a privilege, and PT_dynamic_privilege for the form written with a column list. The server accepts the column list in the grammar and ignores it; it is kept as written. A dynamic privilege can only be granted globally (ER_ILLEGAL_PRIVILEGE_LEVEL otherwise). Which names are registered depends on the server and its components, which a declaration context does not hold. Source: https://dev.mysql.com/doc/refman/8.4/en/privileges-provided.html#privileges-provided-dynamic.

Reading a dynamic privilegedoctest
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('GRANT BACKUP_ADMIN ON *.* TO u')->statement->privileges[0]->name->value // => 'BACKUP_ADMIN'

Properties§

public list<Name> $columns
public Name $name

Methods§

public function __construct(public Name $name, list<Name> $columns = [])

Parameters

$nameNameThe privilege name as written
$columnslist<Name>The column list as written; none when absent
Calls 2
public function render(Output $out): void

Writes the privilege and its column list.

Parameters

$outOutput
Calls 4

Test cases 2§

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

Dedicated tests 1
Other tests reaching this symbol 1

Relations§

Instantiated in 1
Type checks 4