classAccountChecks
final class AccountChecks
Derives the diagnostics of the account clauses of CREATE USER, ALTER USER and GRANT.
Rule: MYSQL-ACCOUNT-CHECKS-001. A REQUIRE clause that names a property twice is RepeatedTlsAttribute (ER_DUP_ARGUMENT). PASSWORD EXPIRE INTERVAL takes 1 to 65535 days, FAILED_LOGIN_ATTEMPTS and PASSWORD_LOCK_TIME 0 to 32767, every other number of an option any integer (MYSQL-ACCOUNT-NUMBER-001). An ATTRIBUTE string that is not a JSON object is InvalidUserAttribute; the JSON text is read with the JSON grammar of RFC 8259, which the server also implements. A factor change names factors 2 or 3, two changes name different factors, and two ADDs add 2 before 3 (InvalidFactorPair). No type facts: the clauses hold no expressions. Terminates: one pass over each list. Source: https://dev.mysql.com/doc/refman/8.4/en/create-user.html, https://dev.mysql.com/doc/refman/8.4/en/alter-user.html. Status: Implemented.
Methods§
public function tls(Derivation $derivation, ?TlsRequirement $tls): voidReports the problems of a REQUIRE clause, when one is written.
Parameters
$derivation | Derivation | |
$tls | ?TlsRequirement |
Called from 3
- method-call SqlSemantics\Platform\MySql\Statement\Account\AlterUser::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/AlterUser.php:103
- method-call SqlSemantics\Platform\MySql\Statement\Account\CreateUser::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/CreateUser.php:92
- method-call SqlSemantics\Platform\MySql\Statement\Account\Privilege\GrantPrivileges::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/Privilege/GrantPrivileges.php:96
Calls 2
- method-call Derivation::report() line 47
- new RepeatedTlsAttribute line 47
public function options(Derivation $derivation, list<AccountOption> $options): voidReports the numbers of password and locking options outside their range.
Parameters
$derivation | Derivation | |
$options | list<AccountOption> |
Called from 2
- method-call SqlSemantics\Platform\MySql\Statement\Account\AlterUser::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/AlterUser.php:104
- method-call SqlSemantics\Platform\MySql\Statement\Account\CreateUser::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/CreateUser.php:93
Calls 6
- new NumberChecks line 60
- class-const AccountOptionKind::ExpireInterval() line 62
- class-const AccountOptionKind::FailedLoginAttempts() line 63
- class-const AccountOptionKind::LockTime() line 64
- function-call
implodeline 68 - method-call NumberChecks::range() line 69
public function comment(Derivation $derivation, ?UserComment $comment): voidReports an ATTRIBUTE string that is not a JSON object.
Parameters
$derivation | Derivation | |
$comment | ?UserComment |
Called from 2
- method-call SqlSemantics\Platform\MySql\Statement\Account\AlterUser::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/AlterUser.php:105
- method-call SqlSemantics\Platform\MySql\Statement\Account\CreateUser::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/CreateUser.php:94
Calls 4
- class-const CommentKind::Attribute() line 79
- function-call
json_decodeline 79 - method-call Derivation::report() line 80
- new InvalidUserAttribute line 80
public function factors(Derivation $derivation, FactorChange $change): voidReports the factor numbers and the factor pair of an ALTER USER factor change.
Parameters
$derivation | Derivation | |
$change | FactorChange |
Called from 1
Calls 7
- new NumberChecks line 89
- method-call NumberChecks::factor() line 91
- function-call
countline 93 - method-call Derivation::report() line 97
- new InvalidFactorPair line 97
- class-const FactorAction::Add() line 98
- method-call NumberChecks::compare() 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
AccountChecksTestcalls
Relations§
Instantiated in 3
- new SqlSemantics\Platform\MySql\Statement\Account\AlterUser::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/AlterUser.php:95
- new SqlSemantics\Platform\MySql\Statement\Account\CreateUser::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/CreateUser.php:91
- new SqlSemantics\Platform\MySql\Statement\Account\Privilege\GrantPrivileges::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/Privilege/GrantPrivileges.php:96
Method calls 8
- method-call SqlSemantics\Platform\MySql\Statement\Account\AlterUser::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/AlterUser.php:98
- method-call SqlSemantics\Platform\MySql\Statement\Account\AlterUser::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/AlterUser.php:103
- method-call SqlSemantics\Platform\MySql\Statement\Account\AlterUser::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/AlterUser.php:104
- method-call SqlSemantics\Platform\MySql\Statement\Account\AlterUser::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/AlterUser.php:105
- method-call SqlSemantics\Platform\MySql\Statement\Account\CreateUser::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/CreateUser.php:92
- method-call SqlSemantics\Platform\MySql\Statement\Account\CreateUser::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/CreateUser.php:93
- method-call SqlSemantics\Platform\MySql\Statement\Account\CreateUser::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/CreateUser.php:94
- method-call SqlSemantics\Platform\MySql\Statement\Account\Privilege\GrantPrivileges::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/Privilege/GrantPrivileges.php:96