classRevokePrivileges
final class RevokePrivileges
implements Statement
uses Snapshot
Public API: explicitly declared with
@visibility public.REVOKE [IF EXISTS] privileges ON [kind] level FROM accounts [IGNORE UNKNOWN USER]: a request to revoke privileges.
Mirrors the SQLCOM_REVOKE path of LEX (grant_if_exists, ignore_unknown_user, 8.0.30+). Rule: MYSQL-REVOKE-001. The level and its table are derived by MYSQL-PRIVILEGE-CHECKS-001; REVOKE does not require the table to exist, and under IF EXISTS a dynamic privilege at another level is only a warning. MySQL 5.6 writes the account list of GRANT here, with an optional IDENTIFIED clause per account. Source: https://dev.mysql.com/doc/refman/8.4/en/revoke.html. Status: Implemented.
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('revoke if exists execute on procedure p from u ignore unknown user')->toString() // => 'REVOKE IF EXISTS EXECUTE ON PROCEDURE p FROM u IGNORE UNKNOWN USER'Properties§
public list<Grantable> $privilegespublic list<UserSpecification> $userspublic bool $ifExistspublic ObjectKind $kindpublic PrivilegeLevel $levelpublic bool $ignoreUnknownUser = falseMethods§
public function __construct(
public bool $ifExists,
list<Grantable> $privileges,
public ObjectKind $kind,
public PrivilegeLevel $level,
list<UserSpecification> $users,
public bool $ignoreUnknownUser = false,
)Parameters
$ifExists | bool | Whether IF EXISTS is written |
$privileges | list<Grantable> | The revoked privileges in order; ALL stands alone |
$kind | ObjectKind | The kind of object the level names |
$level | PrivilegeLevel | The privilege level |
$users | list<UserSpecification> | The accounts privileges are revoked from; at least one |
$ignoreUnknownUser | bool | Whether IGNORE UNKNOWN USER is written |
Calls 5
- static-call Check::listOf() line 65
- class-const Grantable::class() line 65
- class-const UserSpecification::class() line 66
- static-call Check::input() line 68
- function-call
countline 68
public function deriveStatement(Derivation $derivation): voidDerives the level and the table.
Parameters
$derivation | Derivation |
Calls 2
- method-call PrivilegeChecks::revoke() line 81
- new PrivilegeChecks line 81
public function render(Output $out): voidWrites the request.
Parameters
$out | Output |
Calls 4
- method-call Output::keyword() line 89
- method-call Output::list() line 93
- method-call ObjectKind::keyword() line 94
- method-call Output::node() line 98
Test cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Relations§
Instantiated in 3
- new SqlSemantics\Platform\MySql\Lowering\Account\GrantRule::revoke() packages/sql-semantics-mysql/src/Lowering/Account/GrantRule.php:124
- new SqlSemantics\Platform\MySql\Lowering\Account\GrantRule::revokeAll() packages/sql-semantics-mysql/src/Lowering/Account/GrantRule.php:151
- new SqlSemantics\Platform\MySql\Lowering\Account\LegacyGrantRule::revoke() packages/sql-semantics-mysql/src/Lowering/Account/LegacyGrantRule.php:115