classUserStatementRule
final class UserStatementRule
Lowers CREATE USER, ALTER USER, DROP USER and RENAME USER of every release.
Rule: MYSQL-ACCOUNT-USER-001. Scope: the create:, alter: and drop: productions MYSQL-DEFINITION-ROUTES-001 routes here (5.x), alter_user_stmt, alter_user_command, drop_user_stmt (8.0+), alter_user_list of 5.6, rename_list, user_func, opt_user_registration. The marker clear_privileges holds no operand. Constructs: CreateUser, AlterUser, ExpireUserPasswords, AlterDefaultRole, AlterRegistration, DropUser, RenameUser, SessionUser. Terminates: the lists are flattened iteratively; every other child is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/account-management-statements.html. Status: Implemented.
Methods§
public function __construct(private Lowering $lowering)Parameters
$lowering | Lowering | The lowering this rule belongs to |
Calls 3
Lowers a routed create:, alter: or drop: production of an account statement.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 21
- method-call UserStatementRule::skipped() line 76
- new CreateUser line 76
- method-call UserListRule::granted() line 76
- method-call Form::node() line 76
- method-call ClauseRule::tls() line 81
- method-call ClauseRule::limits() line 82
- method-call ClauseRule::options() line 83
- method-call UserListRule::created() line 87
- method-call UserStatementRule::defaultRoles() line 88
- method-call ClauseRule::comment() line 92
- new ExpireUserPasswords line 94
- method-call UserStatementRule::expired() line 94
- new AlterUser line 95
- method-call UserStatementRule::command() line 96
- new UserSpecification line 103
- method-call UserStatementRule::session() line 103
- new Identification line 103
- class-const Credential::Password() line 103
- method-call ClauseRule::string() line 103
- new DropUser line 105
- static-call ImplementationGap::production() line 107
Confirms the clear_privileges marker at a position and answers the statement.
Returns
Called from 5
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::definition() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:76
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::definition() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:77
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::definition() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:94
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::definition() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:105
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::definition() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:106
Calls 1
- method-call Form::node() line 116
Lowers an 8.0 alter_user_stmt.
Parameters
$form | Form |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 22
- method-call UserStatementRule::command() line 128
- method-call Form::node() line 128
- new AlterUser line 133
- method-call UserListRule::altered() line 135
- method-call ClauseRule::tls() line 136
- method-call ClauseRule::limits() line 137
- method-call ClauseRule::options() line 138
- method-call ClauseRule::comment() line 139
- new UserSpecification line 142
- method-call UserStatementRule::session() line 143
- method-call IdentificationRule::identification() line 144
- method-call IdentificationRule::replace() line 147
- method-call IdentificationRule::retain() line 148
- new AlterDefaultRole line 151
- new RoleSelection line 151
- class-const RoleSet::All() line 151
- class-const RoleSet::None() line 152
- class-const RoleSet::Named() line 156
- method-call RoleRule::roles() line 156
- new RoleRule line 156
- method-call UserStatementRule::registration() line 158
- static-call ImplementationGap::production() line 160
public function command(Node $command): boolLowers an alter_user_command: whether IF EXISTS is written.
Parameters
$command | Node |
Returns
boolThrows
ImplementationGap When the production has no ruleCalled from 3
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::definition() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:96
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::definition() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:102
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::alter() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:128
Calls 2
- method-call Lowering::form() line 171
- static-call ImplementationGap::production() line 175
public function session(Node $function): SessionUserLowers a user_func: USER().
Parameters
$function | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 4
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::definition() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:103
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::alter() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:143
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::alter() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:150
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::alter() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:159
Calls 3
- method-call Lowering::form() line 188
- static-call ImplementationGap::production() line 190
- new SessionUser line 193
public function registration(
bool $ifExists,
Account|SessionUser $user,
Node $registration,
): AlterRegistrationLowers an opt_user_registration of an account.
Parameters
$ifExists | bool | |
$user | Account|SessionUser | |
$registration | Node |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 2
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::alter() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:158
- method-call SqlSemantics\Platform\MySql\Lowering\Account\UserStatementRule::alter() packages/sql-semantics-mysql/src/Lowering/Account/UserStatementRule.php:159
Calls 7
- method-call Lowering::form() line 203
- method-call IdentificationRule::factor() line 204
- new AlterRegistration line 207
- class-const RegistrationStep::Initiate() line 207
- class-const RegistrationStep::Unregister() line 208
- class-const RegistrationStep::Finish() line 213
- static-call ImplementationGap::production() line 216
public function defaultRoles(Node $clause): list<AccountName>Lowers the DEFAULT ROLE clause of CREATE USER; an absent clause is empty.
Parameters
$clause | Node |
Returns
list<AccountName>Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 4
- method-call Lowering::form() line 228
- method-call RoleRule::roles() line 232
- new RoleRule line 232
- static-call ImplementationGap::production() line 233
Lowers the MySQL 5.6 alter_user_list: accounts each followed by PASSWORD EXPIRE.
Parameters
$list | Node |
Returns
list<Account>Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 3
- method-call Lowering::form() line 248
- function-call
array_unshiftline 250 - static-call ImplementationGap::production() line 255
Lowers DROP USER (8.0+).
Parameters
$form | Form |
Returns
Throws
ImplementationGap When the production has no ruleCalled from 1
Calls 3
- static-call ImplementationGap::production() line 270
- new DropUser line 273
- method-call Form::node() line 273
public function rename(Node $list): RenameUserLowers the rename_list of RENAME USER.
Parameters
$list | Node |
Returns
Throws
ImplementationGap When a production has no ruleCalled from 1
Calls 7
- method-call Lowering::form() line 283
- static-call ImplementationGap::production() line 285
- method-call Lists::items() line 287
- new Lists line 287
- function-call
countline 289 - new UserRenaming line 290
- new RenameUser line 293
Private surface 4§
Implementation details, listed for orientation only.
private ClauseRule $clausesprivate IdentificationRule $identificationsprivate UserListRule $listsprivate Lowering $loweringTest cases 1§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
UserStatementRuleTestcalls
Relations§
Instantiated in 4
- new SqlSemantics\Platform\MySql\Lowering\Account\AccountRules::statement() packages/sql-semantics-mysql/src/Lowering/Account/AccountRules.php:61
- new SqlSemantics\Platform\MySql\Lowering\Account\AccountRules::statement() packages/sql-semantics-mysql/src/Lowering/Account/AccountRules.php:62
- new SqlSemantics\Platform\MySql\Lowering\Account\AccountRules::definition() packages/sql-semantics-mysql/src/Lowering/Account/AccountRules.php:77
- new SqlSemantics\Platform\MySql\Lowering\Account\AccountRules::renameUsers() packages/sql-semantics-mysql/src/Lowering/Account/AccountRules.php:87
Method calls 4
- method-call SqlSemantics\Platform\MySql\Lowering\Account\AccountRules::statement() packages/sql-semantics-mysql/src/Lowering/Account/AccountRules.php:61
- method-call SqlSemantics\Platform\MySql\Lowering\Account\AccountRules::statement() packages/sql-semantics-mysql/src/Lowering/Account/AccountRules.php:62
- method-call SqlSemantics\Platform\MySql\Lowering\Account\AccountRules::definition() packages/sql-semantics-mysql/src/Lowering/Account/AccountRules.php:77
- method-call SqlSemantics\Platform\MySql\Lowering\Account\AccountRules::renameUsers() packages/sql-semantics-mysql/src/Lowering/Account/AccountRules.php:87