classNumeral
final class Numeral
implements Node
uses Snapshot
Public API: explicitly declared with
@visibility public.A number at a position that is not an expression: an option value, a count, a size, an identifier of a thread or server.
The digits are kept exactly. The grammar also accepts a hexadecimal literal at these positions, and at some of them a decimal or floating number that the server then rejects; each is kept as written. Source: https://dev.mysql.com/doc/refman/8.4/en/number-literals.html.
$number = new \SqlSemantics\Platform\MySql\Statement\Literal\Numeral('007');
[$number->text, $number->hexadecimal] // => ['007', false]Properties§
public string $textpublic bool $hexadecimal = falseMethods§
public function __construct(public string $text, public bool $hexadecimal = false)Parameters
$text | string | The number exactly as written, or the digits of a hexadecimal literal |
$hexadecimal | bool | Whether the text is the digits of a hexadecimal literal |
Calls 2
- static-call Check::input() line 36
- function-call
preg_matchline 37
public function render(Output $out): voidWrites the number, a hexadecimal one in the spelling its digit count permits.
Parameters
$out | Output |
Test cases 3
Calls 3
- method-call Output::spelled() line 47
- method-call RadixSpelling::hexadecimal() line 47
- new RadixSpelling line 47
Test cases 57§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 6
NumeralTest::testRejectsASignedNumbercallsNumeralTest::testRejectsAWordAsADecimalNumbercallsNumeralTest::testRejectsNonHexadecimalDigitscallsNumeralTest::testRenderPrefixesAnOddCountOfHexadecimalDigitscallsNumeralTest::testRenderQuotesAnEvenCountOfHexadecimalDigitscallsNumeralTest::testRenderWritesTheExactDecimalTextcalls
Other tests reaching this symbol 51
TemporalRuleTest::testCallLowersTheTemporalSyntaxescallsTemporalRuleTest::testCurrentTimestampLowersNowcallsConditionRuleTest::testHandledLowersEveryKindOfConditioncallsConditionRuleTest::testValueLowersAnErrorCodeAndAnSqlstatecallsNumberChecksTest::testValueComputesTheExactDecimalcallsMagnitudesTest::testExceedsTreatsAnOverflowAsBeyondTheBoundcallsMagnitudesTest::testFlagAcceptsZeroAndOnecallsMagnitudesTest::testFractionalRecognisesDecimalAndFloatingNumberscallsMagnitudesTest::testIntegerReadsTheIntegerPrefixAndHexadecimalDigitscallsReplicaConditionsTest::testUntilAcceptsCompletePositionsAndLoneConditionscallsSourceSettingsTest::testNumberAnswersTheNumberCheckscallsConditionFactsTest::providerSameComparesTheValuescallsConditionFactsTest::testMeaningAnswersTheDeclaredValueOfAConditionNamecallsProgramScopeTest::testConditionFindsTheInnermostDeclarationOfTheNamecallsProgramScopeTest::testDeclaredReplacesTheEnvironmentConditionsAndCursorscallsProgramScopeTest::testHandlerSeesNoLabelOutsideTheHandlercallsHistogramsTest::testBucketsTellsWhetherTheCountIsInRangecallsMagnitudesTest::testAtMostComparesTheDigitsExactlycallsMagnitudesTest::testFormatTakesAnyNumberOnMySql56OnlycallsMagnitudesTest::testIdentifierRefusesAFormatTheReleaseRejectscallsMagnitudesTest::testIntegralTellsWhetherANumberIsAnIntegercallsStorageOptionsTest::testUnsetTellsTheServersUnsetValuescallsThreadPriorityTest::testDescribeWritesTheSigncallsClockCallTest::testDeriveScalarAnswersATemporalTypeThatIsNeverNullcallsWeightLevelRangeTest::testRenderWritesTheRangecallsWeightLevelTest::testRenderWritesTheFlagscallsWeightStringParametersTest::testDeriveScalarAnswersABinaryStringcallsWeightStringParametersTest::testRenderWritesTheNumberscallsWeightStringTest::testRenderWritesTheCastAndTheLevelscallsLoadInputTest::testRenderRejectsAnotherWordcallsByteSizeTest::testRejectsASizeWithBothNumberAndWordcallsByteSizeTest::testRenderWritesTheNumbercallsReplicaUntilTest::testPositionsRejectAnOptionThatIsNotAPositioncallsChangeReplicationSourceTest::testDeriveStatementRejectsAnOptionOfALaterReleasecallsSourceOptionKindTest::testAcceptsChecksTheDomainOfTheOptioncallsSourceOptionTest::testValueRejectsAValueOutsideTheDomaincallsErrorCodeTest::testDigitsAnswersTheDigitsTheGrammarConvertscallsErrorCodeTest::testNumberAnswersTheErrorNumberTheServerKeepscallsErrorCodeTest::testRenderWritesTheCodecallsErrorCodeTest::testValidTellsWhetherTheCodeIsNotZerocallsDatabaseReadOnlyTest::testReadOnlyTellsWhetherTheNumberIsNotZerocallsBucketCountOutOfRangeTest::testMessageDescribesTheProblemcallsFractionalNumberTest::testMessageDescribesTheProblemcallsNodegroupOptionTest::testKeywordNamesTheOptioncallsSizeOptionTest::testKeywordAnswersTheKindcallsXaCommitTest::testDeriveStatementRefusesAFormatAboveTheSignedRangeAfterMySql56callsXaEndTest::testDeriveStatementRefusesAFormatAboveTheSignedRangeAfterMySql56callsXaPrepareTest::testDeriveStatementRefusesAFormatAboveTheSignedRangeAfterMySql56callsXaRollbackTest::testDeriveStatementRefusesAFormatAboveTheSignedRangeAfterMySql56callsXaStartTest::testDeriveStatementRefusesAFormatAboveTheSignedRangeAfterMySql56callsExplainConnectionTest::testRefusesAModifierWithOptionscalls
Relations§
Instantiated in 2
Constant reads 2
- class-const SqlSemantics\Platform\MySql\Statement\Account\ResourceGroup\SetResourceGroup::__construct() packages/sql-semantics-mysql/src/Statement/Account/ResourceGroup/SetResourceGroup.php:44
- class-const SqlSemantics\Platform\MySql\Statement\Replication\Source\ServerIds::__construct() packages/sql-semantics-mysql/src/Statement/Replication/Source/ServerIds.php:36
Type checks 3
- instanceof SqlSemantics\Platform\MySql\Rules\Replication\SourceSettings::error() packages/sql-semantics-mysql/src/Rules/Replication/SourceSettings.php:94
- instanceof SqlSemantics\Platform\MySql\Statement\Replication\Source\SourceOptionKind::accepts() packages/sql-semantics-mysql/src/Statement/Replication/Source/SourceOptionKind.php:102
- instanceof SqlSemantics\Platform\MySql\Statement\Server\ForeignServer\ServerOption::__construct() packages/sql-semantics-mysql/src/Statement/Server/ForeignServer/ServerOption.php:36
Type declarations 77
- type SqlSemantics\Platform\MySql\Lowering\Account\IdentificationRule packages/sql-semantics-mysql/src/Lowering/Account/IdentificationRule.php:169
- type SqlSemantics\Platform\MySql\Lowering\Account\ResourceGroupRule packages/sql-semantics-mysql/src/Lowering/Account/ResourceGroupRule.php:222
- type SqlSemantics\Platform\MySql\Lowering\Call\TemporalRule packages/sql-semantics-mysql/src/Lowering/Call/TemporalRule.php:170
- type SqlSemantics\Platform\MySql\Lowering\Call\WeightRule packages/sql-semantics-mysql/src/Lowering/Call/WeightRule.php:110
- type SqlSemantics\Platform\MySql\Lowering\Call\WeightRule packages/sql-semantics-mysql/src/Lowering/Call/WeightRule.php:194
- type SqlSemantics\Platform\MySql\Lowering\Dml\LoadRule packages/sql-semantics-mysql/src/Lowering/Dml/LoadRule.php:237
- type SqlSemantics\Platform\MySql\Lowering\Leaf\NumberRule packages/sql-semantics-mysql/src/Lowering/Leaf/NumberRule.php:65
- type SqlSemantics\Platform\MySql\Lowering\Leaf\NumberRule packages/sql-semantics-mysql/src/Lowering/Leaf/NumberRule.php:84
- type SqlSemantics\Platform\MySql\Lowering\Leaf\NumberRule packages/sql-semantics-mysql/src/Lowering/Leaf/NumberRule.php:113
- type SqlSemantics\Platform\MySql\Lowering\Replication\ResetRule packages/sql-semantics-mysql/src/Lowering/Replication/ResetRule.php:130
- type SqlSemantics\Platform\MySql\Lowering\Replication\SourceValueRule packages/sql-semantics-mysql/src/Lowering/Replication/SourceValueRule.php:59
- type SqlSemantics\Platform\MySql\Lowering\Server\Maintenance\MaintenanceRule packages/sql-semantics-mysql/src/Lowering/Server/Maintenance/MaintenanceRule.php:253
- type SqlSemantics\Platform\MySql\Lowering\Server\Maintenance\MaintenanceRule packages/sql-semantics-mysql/src/Lowering/Server/Maintenance/MaintenanceRule.php:267
- type SqlSemantics\Platform\MySql\Lowering\Server\Transaction\XaRule packages/sql-semantics-mysql/src/Lowering/Server/Transaction/XaRule.php:177
- type SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:220
- type SqlSemantics\Platform\MySql\Lowering\TableChange\Partition\PartitionRule packages/sql-semantics-mysql/src/Lowering/TableChange/Partition/PartitionRule.php:236
- type SqlSemantics\Platform\MySql\Lowering\TableDefinition\Key\KeyPartRule packages/sql-semantics-mysql/src/Lowering/TableDefinition/Key/KeyPartRule.php:119
- type SqlSemantics\Platform\MySql\Lowering\Utility\Show\ClauseRule packages/sql-semantics-mysql/src/Lowering/Utility/Show/ClauseRule.php:233
- type SqlSemantics\Platform\MySql\Lowering\Utility\Show\ClauseRule packages/sql-semantics-mysql/src/Lowering/Utility/Show/ClauseRule.php:279
- type SqlSemantics\Platform\MySql\Rules\Account\NumberChecks packages/sql-semantics-mysql/src/Rules/Account/NumberChecks.php:31
- type SqlSemantics\Platform\MySql\Rules\Account\NumberChecks packages/sql-semantics-mysql/src/Rules/Account/NumberChecks.php:63
- type SqlSemantics\Platform\MySql\Rules\Account\NumberChecks packages/sql-semantics-mysql/src/Rules/Account/NumberChecks.php:76
- type SqlSemantics\Platform\MySql\Rules\Replication\Magnitudes packages/sql-semantics-mysql/src/Rules/Replication/Magnitudes.php:30
- type SqlSemantics\Platform\MySql\Rules\Replication\Magnitudes packages/sql-semantics-mysql/src/Rules/Replication/Magnitudes.php:45
- type SqlSemantics\Platform\MySql\Rules\Replication\Magnitudes packages/sql-semantics-mysql/src/Rules/Replication/Magnitudes.php:55
- type SqlSemantics\Platform\MySql\Rules\Replication\Magnitudes packages/sql-semantics-mysql/src/Rules/Replication/Magnitudes.php:65
- type SqlSemantics\Platform\MySql\Rules\Replication\SourceSettings packages/sql-semantics-mysql/src/Rules/Replication/SourceSettings.php:125
- type SqlSemantics\Platform\MySql\Rules\Server\Histograms packages/sql-semantics-mysql/src/Rules/Server/Histograms.php:70
- type SqlSemantics\Platform\MySql\Rules\Server\Magnitudes packages/sql-semantics-mysql/src/Rules/Server/Magnitudes.php:60
- type SqlSemantics\Platform\MySql\Rules\Server\Magnitudes packages/sql-semantics-mysql/src/Rules/Server/Magnitudes.php:68
- type SqlSemantics\Platform\MySql\Rules\Server\Magnitudes packages/sql-semantics-mysql/src/Rules/Server/Magnitudes.php:81
- type SqlSemantics\Platform\MySql\Rules\Server\Magnitudes packages/sql-semantics-mysql/src/Rules/Server/Magnitudes.php:99
- type SqlSemantics\Platform\MySql\Rules\Server\SpatialChecks packages/sql-semantics-mysql/src/Rules/Server/SpatialChecks.php:42
- type SqlSemantics\Platform\MySql\Statement\Account\AlterRegistration packages/sql-semantics-mysql/src/Statement/Account/AlterRegistration.php:45
- type SqlSemantics\Platform\MySql\Statement\Account\Option\AccountOption packages/sql-semantics-mysql/src/Statement/Account/Option/AccountOption.php:34
- type SqlSemantics\Platform\MySql\Statement\Account\Option\ResourceLimit packages/sql-semantics-mysql/src/Statement/Account/Option/ResourceLimit.php:30
- type SqlSemantics\Platform\MySql\Statement\Account\ResourceGroup\CpuRange packages/sql-semantics-mysql/src/Statement/Account/ResourceGroup/CpuRange.php:32
- type SqlSemantics\Platform\MySql\Statement\Account\ResourceGroup\ThreadPriority packages/sql-semantics-mysql/src/Statement/Account/ResourceGroup/ThreadPriority.php:30
- type SqlSemantics\Platform\MySql\Statement\Account\User\FactorStep packages/sql-semantics-mysql/src/Statement/Account/User/FactorStep.php:30
- type SqlSemantics\Platform\MySql\Statement\Alter\Partition\AddPartition packages/sql-semantics-mysql/src/Statement/Alter/Partition/AddPartition.php:43
- type SqlSemantics\Platform\MySql\Statement\Alter\Partition\CoalescePartition packages/sql-semantics-mysql/src/Statement/Alter/Partition/CoalescePartition.php:32
- type SqlSemantics\Platform\MySql\Statement\Call\ClockCall packages/sql-semantics-mysql/src/Statement/Call/ClockCall.php:50
- type SqlSemantics\Platform\MySql\Statement\Call\Weight\WeightLevel packages/sql-semantics-mysql/src/Statement/Call/Weight/WeightLevel.php:32
- type SqlSemantics\Platform\MySql\Statement\Call\Weight\WeightLevelRange packages/sql-semantics-mysql/src/Statement/Call/Weight/WeightLevelRange.php:30
- type SqlSemantics\Platform\MySql\Statement\Call\Weight\WeightString packages/sql-semantics-mysql/src/Statement/Call/Weight/WeightString.php:56
- type SqlSemantics\Platform\MySql\Statement\Call\Weight\WeightStringParameters packages/sql-semantics-mysql/src/Statement/Call/Weight/WeightStringParameters.php:42
- type SqlSemantics\Platform\MySql\Statement\Dml\Load\BulkOptions packages/sql-semantics-mysql/src/Statement/Dml/Load/BulkOptions.php:35
- type SqlSemantics\Platform\MySql\Statement\Dml\Load\LoadInput packages/sql-semantics-mysql/src/Statement/Dml/Load/LoadInput.php:50
- type SqlSemantics\Platform\MySql\Statement\Dml\Load\LoadTable packages/sql-semantics-mysql/src/Statement/Dml/Load/LoadTable.php:89
- type SqlSemantics\Platform\MySql\Statement\Literal\ByteSize packages/sql-semantics-mysql/src/Statement/Literal/ByteSize.php:34
- type SqlSemantics\Platform\MySql\Statement\Partition\Method\KeyMethod packages/sql-semantics-mysql/src/Statement/Partition/Method/KeyMethod.php:44
- type SqlSemantics\Platform\MySql\Statement\Partition\PartitionClause packages/sql-semantics-mysql/src/Statement/Partition/PartitionClause.php:51
- type SqlSemantics\Platform\MySql\Statement\Partition\PartitionOption packages/sql-semantics-mysql/src/Statement/Partition/PartitionOption.php:42
- type SqlSemantics\Platform\MySql\Statement\Partition\Subpartitioning packages/sql-semantics-mysql/src/Statement/Partition/Subpartitioning.php:38
- type SqlSemantics\Platform\MySql\Statement\Replication\Reset\ResetBinaryLogs packages/sql-semantics-mysql/src/Statement/Replication/Reset/ResetBinaryLogs.php:49
- type SqlSemantics\Platform\MySql\Statement\Replication\Source\SourceOption packages/sql-semantics-mysql/src/Statement/Replication/Source/SourceOption.php:43
- type SqlSemantics\Platform\MySql\Statement\Replication\Source\SourceOptionKind packages/sql-semantics-mysql/src/Statement/Replication/Source/SourceOptionKind.php:94
- type SqlSemantics\Platform\MySql\Statement\Routine\Condition\ErrorCode packages/sql-semantics-mysql/src/Statement/Routine/Condition/ErrorCode.php:36
- type SqlSemantics\Platform\MySql\Statement\Server\Database\DatabaseReadOnly packages/sql-semantics-mysql/src/Statement/Server/Database/DatabaseReadOnly.php:30
- type SqlSemantics\Platform\MySql\Statement\Server\ForeignServer\ServerOption packages/sql-semantics-mysql/src/Statement/Server/ForeignServer/ServerOption.php:34
- type SqlSemantics\Platform\MySql\Statement\Server\Instance\CloneInstance packages/sql-semantics-mysql/src/Statement/Server/Instance/CloneInstance.php:46
- type SqlSemantics\Platform\MySql\Statement\Server\Maintenance\UpdateHistogram packages/sql-semantics-mysql/src/Statement/Server/Maintenance/UpdateHistogram.php:42
- type SqlSemantics\Platform\MySql\Statement\Server\Problem\BucketCountOutOfRange packages/sql-semantics-mysql/src/Statement/Server/Problem/BucketCountOutOfRange.php:29
- type SqlSemantics\Platform\MySql\Statement\Server\Problem\FractionalNumber packages/sql-semantics-mysql/src/Statement/Server/Problem/FractionalNumber.php:29
- type SqlSemantics\Platform\MySql\Statement\Server\Spatial\CreateSpatialReference packages/sql-semantics-mysql/src/Statement/Server/Spatial/CreateSpatialReference.php:47
- type SqlSemantics\Platform\MySql\Statement\Server\Spatial\DropSpatialReference packages/sql-semantics-mysql/src/Statement/Server/Spatial/DropSpatialReference.php:35
- type SqlSemantics\Platform\MySql\Statement\Server\Spatial\SpatialAttribute packages/sql-semantics-mysql/src/Statement/Server/Spatial/SpatialAttribute.php:37
- type SqlSemantics\Platform\MySql\Statement\Server\Storage\Option\NodegroupOption packages/sql-semantics-mysql/src/Statement/Server/Storage/Option/NodegroupOption.php:28
- type SqlSemantics\Platform\MySql\Statement\Server\Transaction\Xa\Xid packages/sql-semantics-mysql/src/Statement/Server/Transaction/Xa/Xid.php:43
- type SqlSemantics\Platform\MySql\Statement\Table\Column\SridAttribute packages/sql-semantics-mysql/src/Statement/Table/Column/SridAttribute.php:30
- type SqlSemantics\Platform\MySql\Statement\Table\Key\ColumnPart packages/sql-semantics-mysql/src/Statement/Table/Key/ColumnPart.php:38
- type SqlSemantics\Platform\MySql\Statement\Table\Key\Option\KeyBlockSize packages/sql-semantics-mysql/src/Statement/Table/Key/Option/KeyBlockSize.php:28
- type SqlSemantics\Platform\MySql\Statement\Table\Option\NumberOption packages/sql-semantics-mysql/src/Statement/Table/Option/NumberOption.php:33
- type SqlSemantics\Platform\MySql\Statement\Utility\Explain\ExplainConnection packages/sql-semantics-mysql/src/Statement/Utility/Explain/ExplainConnection.php:45
- type SqlSemantics\Platform\MySql\Statement\Utility\Show\Replication\ShowBinlogEvents packages/sql-semantics-mysql/src/Statement/Utility/Show/Replication/ShowBinlogEvents.php:41
- type SqlSemantics\Platform\MySql\Statement\Utility\Show\Replication\ShowRelaylogEvents packages/sql-semantics-mysql/src/Statement/Utility/Show/Replication/ShowRelaylogEvents.php:43
- type SqlSemantics\Platform\MySql\Statement\Utility\Show\Session\ShowProfile packages/sql-semantics-mysql/src/Statement/Utility/Show/Session/ShowProfile.php:50