classNumberChecks
final class NumberChecks
Checks the numbers of account statements against the ranges the server's grammar actions enforce.
Rule: MYSQL-ACCOUNT-NUMBER-001. A numeral is an integer when it is written with digits only or as a hexadecimal literal; its value is computed exactly in decimal digits, without a PHP integer or float. A decimal or floating number at an integer position (real_ulong_num through dec_num_error) is NumberOutOfRange with ER_ONLY_INTEGERS_ALLOWED; an integer outside the range of its option is NumberOutOfRange with ER_WRONG_VALUE. Precision: exact. Terminates: one pass over the digits. Source: https://dev.mysql.com/doc/refman/8.4/en/create-user.html#create-user-password-management, https://dev.mysql.com/doc/refman/8.4/en/number-literals.html. Status: Implemented.
Methods§
public function value(Numeral $number): ?stringAnswers the decimal digits of an integer numeral without leading zeros, or null for a decimal or floating number.
Parameters
$number | Numeral |
Returns
?stringTest cases 1
Called from 2
- method-call SqlSemantics\Platform\MySql\Rules\Account\NumberChecks::range() packages/sql-semantics-mysql/src/Rules/Account/NumberChecks.php:65
- method-call SqlSemantics\Platform\MySql\Statement\Account\ResourceGroup\CreateResourceGroup::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/ResourceGroup/CreateResourceGroup.php:58
public function compare(string $left, string $right): intCompares two decimal digit strings without leading zeros: negative, zero or positive.
Parameters
$left | string | |
$right | string |
Returns
intTest cases 1
Called from 4
- method-call SqlSemantics\Platform\MySql\Rules\Account\AccountChecks::factors() packages/sql-semantics-mysql/src/Rules/Account/AccountChecks.php:98
- method-call SqlSemantics\Platform\MySql\Rules\Account\NumberChecks::range() packages/sql-semantics-mysql/src/Rules/Account/NumberChecks.php:68
- method-call SqlSemantics\Platform\MySql\Statement\Account\ResourceGroup\CreateResourceGroup::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/ResourceGroup/CreateResourceGroup.php:61
- method-call SqlSemantics\Platform\MySql\Statement\Account\ResourceGroup\CreateResourceGroup::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/ResourceGroup/CreateResourceGroup.php:62
public function range(
Derivation $derivation,
Numeral $number,
string $option,
string $minimum,
?string $maximum,
): voidReports a numeral that is no integer, or that lies outside the inclusive range of its option; a null maximum is no upper bound.
Parameters
$derivation | Derivation | |
$number | Numeral | |
$option | string | |
$minimum | string | |
$maximum | ?string |
Called from 2
- method-call SqlSemantics\Platform\MySql\Rules\Account\AccountChecks::options() packages/sql-semantics-mysql/src/Rules/Account/AccountChecks.php:69
- method-call SqlSemantics\Platform\MySql\Statement\Account\ResourceGroup\SetResourceGroup::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/ResourceGroup/SetResourceGroup.php:53
Calls 4
- method-call NumberChecks::value() line 65
- method-call Derivation::report() line 67
- new NumberOutOfRange line 67
- method-call NumberChecks::compare() line 68
public function factor(Derivation $derivation, Numeral $factor): voidReports a factor number other than 2 and 3, which the server compares as written.
Parameters
$derivation | Derivation | |
$factor | Numeral |
Called from 2
- method-call SqlSemantics\Platform\MySql\Rules\Account\AccountChecks::factors() packages/sql-semantics-mysql/src/Rules/Account/AccountChecks.php:91
- method-call SqlSemantics\Platform\MySql\Statement\Account\AlterRegistration::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/AlterRegistration.php:57
Calls 2
- method-call Derivation::report() line 79
- new NumberOutOfRange line 79
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Relations§
Instantiated in 7
- new SqlSemantics\Platform\MySql\Rules\Account\AccountChecks::options() packages/sql-semantics-mysql/src/Rules/Account/AccountChecks.php:60
- new SqlSemantics\Platform\MySql\Rules\Account\AccountChecks::factors() packages/sql-semantics-mysql/src/Rules/Account/AccountChecks.php:89
- new SqlSemantics\Platform\MySql\Statement\Account\AlterRegistration::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/AlterRegistration.php:57
- new SqlSemantics\Platform\MySql\Statement\Account\ResourceGroup\CreateResourceGroup::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/ResourceGroup/CreateResourceGroup.php:58
- new SqlSemantics\Platform\MySql\Statement\Account\ResourceGroup\CreateResourceGroup::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/ResourceGroup/CreateResourceGroup.php:61
- new SqlSemantics\Platform\MySql\Statement\Account\ResourceGroup\CreateResourceGroup::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/ResourceGroup/CreateResourceGroup.php:62
- new SqlSemantics\Platform\MySql\Statement\Account\ResourceGroup\SetResourceGroup::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/ResourceGroup/SetResourceGroup.php:53
Method calls 8
- method-call SqlSemantics\Platform\MySql\Rules\Account\AccountChecks::options() packages/sql-semantics-mysql/src/Rules/Account/AccountChecks.php:69
- method-call SqlSemantics\Platform\MySql\Rules\Account\AccountChecks::factors() packages/sql-semantics-mysql/src/Rules/Account/AccountChecks.php:91
- method-call SqlSemantics\Platform\MySql\Rules\Account\AccountChecks::factors() packages/sql-semantics-mysql/src/Rules/Account/AccountChecks.php:98
- method-call SqlSemantics\Platform\MySql\Statement\Account\AlterRegistration::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/AlterRegistration.php:57
- method-call SqlSemantics\Platform\MySql\Statement\Account\ResourceGroup\CreateResourceGroup::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/ResourceGroup/CreateResourceGroup.php:58
- method-call SqlSemantics\Platform\MySql\Statement\Account\ResourceGroup\CreateResourceGroup::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/ResourceGroup/CreateResourceGroup.php:61
- method-call SqlSemantics\Platform\MySql\Statement\Account\ResourceGroup\CreateResourceGroup::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/ResourceGroup/CreateResourceGroup.php:62
- method-call SqlSemantics\Platform\MySql\Statement\Account\ResourceGroup\SetResourceGroup::deriveStatement() packages/sql-semantics-mysql/src/Statement/Account/ResourceGroup/SetResourceGroup.php:53