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

SET DEFAULT ROLE {NONE | ALL | role, …} TO account, … (8.0+): a request to set the default roles of accounts.

Mirrors PT_alter_user_default_role as SET DEFAULT ROLE builds it. Rule: MYSQL-SET-DEFAULT-ROLE-001. The accounts are written in the role name syntax, without CURRENT_USER. Source: https://dev.mysql.com/doc/refman/8.4/en/set-default-role.html. Status: Implemented.

Clearing the default roles of two accountsdoctest
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('set default role none to a, b')->toString() // => 'SET DEFAULT ROLE NONE TO a, b'

Properties§

public list<AccountName> $users
public RoleSelection $roles

Methods§

public function __construct(public RoleSelection $roles, list<AccountName> $users)

Parameters

$rolesRoleSelectionThe default roles: named roles, ALL or NONE
$userslist<AccountName>The accounts in order; at least one
Calls 5
public function deriveStatement(Derivation $derivation): void

Derives nothing: the statement names no relation and no expression.

Parameters

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

Writes the request.

Parameters

$outOutput
Calls 1

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