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.

Revoking a privilegedoctest
(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> $privileges
public list<UserSpecification> $users
public bool $ifExists
public ObjectKind $kind
public bool $ignoreUnknownUser = false

Methods§

public function __construct(
    public bool $ifExists,
    list<Grantable> $privileges,
    public ObjectKind $kind,
    public PrivilegeLevel $level,
    list<UserSpecification> $users,
    public bool $ignoreUnknownUser = false,
)

Parameters

$ifExistsboolWhether IF EXISTS is written
$privilegeslist<Grantable>The revoked privileges in order; ALL stands alone
$kindObjectKindThe kind of object the level names
$levelPrivilegeLevelThe privilege level
$userslist<UserSpecification>The accounts privileges are revoked from; at least one
$ignoreUnknownUserboolWhether IGNORE UNKNOWN USER is written
Calls 5
public function deriveStatement(Derivation $derivation): void

Derives the level and the table.

Parameters

$derivationDerivation
Calls 2
public function render(Output $out): void

Writes the request.

Parameters

$outOutput
Calls 4

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
Type declarations 1