classDynamicPrivilege
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.
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('GRANT BACKUP_ADMIN ON *.* TO u')->statement->privileges[0]->name->value // => 'BACKUP_ADMIN'Properties§
public list<Name> $columnspublic Name $nameMethods§
Parameters
Calls 2
- static-call Check::listOf() line 44
- class-const Name::class() line 44
public function render(Output $out): voidWrites the privilege and its column list.
Parameters
$out | Output |
Calls 4
- method-call Output::name() line 52
- class-const NameUse::Label() line 52
- method-call Output::symbol() line 54
- class-const NameUse::Column() line 59
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
DynamicPrivilegeTestcalls
Other tests reaching this symbol 1
Relations§
Instantiated in 1
Type checks 4
- instanceof SqlSemantics\Platform\MySql\Rules\Account\PrivilegeChecks::level() packages/sql-semantics-mysql/src/Rules/Account/PrivilegeChecks.php:119
- instanceof SqlSemantics\Platform\MySql\Rules\Account\PrivilegeChecks::describe() packages/sql-semantics-mysql/src/Rules/Account/PrivilegeChecks.php:201
- instanceof SqlSemantics\Platform\MySql\Statement\Account\Privilege\GrantRoles::__construct() packages/sql-semantics-mysql/src/Statement/Account/Privilege/GrantRoles.php:56
- instanceof SqlSemantics\Platform\MySql\Statement\Account\Privilege\RevokeRoles::__construct() packages/sql-semantics-mysql/src/Statement/Account/Privilege/RevokeRoles.php:54