final class RevokeRoles
    implements Statement
    uses Snapshot
Public API: explicitly declared with @visibility public.

REVOKE [IF EXISTS] role, … FROM account, … [IGNORE UNKNOWN USER] (8.0+): a request to revoke roles.

Mirrors PT_revoke_roles. Rule: MYSQL-REVOKE-ROLES-001. An item that is no role is a RoleOrPrivilegeMismatch by MYSQL-PRIVILEGE-CHECKS-001. Source: https://dev.mysql.com/doc/refman/8.4/en/revoke.html. Status: Implemented.

Revoking a roledoctest
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('revoke if exists r from u, v')->toString() // => 'REVOKE IF EXISTS r FROM u, v'

Properties§

public list<Grantable> $roles
public list<Account> $users
public bool $ifExists
public bool $ignoreUnknownUser = false

Methods§

public function __construct(
    public bool $ifExists,
    list<Grantable> $roles,
    list<Account> $users,
    public bool $ignoreUnknownUser = false,
)

Parameters

$ifExistsboolWhether IF EXISTS is written
$roleslist<Grantable>The revoked roles in order; at least one
$userslist<Account>The accounts the roles are revoked from; at least one
$ignoreUnknownUserboolWhether IGNORE UNKNOWN USER is written
Calls 4
public function deriveStatement(Derivation $derivation): void

Reports the items that are no roles.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 2

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 1