classBooleanLiteral
final class BooleanLiteral
implements Scalar
uses Snapshot
Public API: explicitly declared with
@visibility public.The literal TRUE or FALSE.
Rule: MYSQL-BOOLEAN-LITERAL-001. Facts: TRUE and FALSE evaluate to the integers 1 and 0, so the type is that of an integer literal, BIGINT; never NULL. Source: https://dev.mysql.com/doc/refman/8.4/en/boolean-literals.html. Status: Implemented.
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT a FROM t WHERE a = TRUE');
$query->statement->where->right->value // => trueProperties§
public bool $valueMethods§
public function __construct(public bool $value)Parameters
$value | bool | Whether the literal is TRUE |
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the integer type; a literal is never NULL.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 5
- new ScalarFact line 47
- new Known line 47
- new Integral line 47
- class-const IntegralKind::BigInt() line 47
- class-const Nullability::NotNull() line 47
public function render(Output $out): voidTest cases 9§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 3
Other tests reaching this symbol 6
ItemNamingTest::testConstantSpellsTheNameArgumentOfNameConstcallsItemNamingTest::testOwnAnswersTheNamesOfTheItemsThatNameThemselvescallsColumnAttributeTest::testDeriveAttributeIsDeclaredByTheInterfacecallsColumnSpecificationTest::testDeriveSpecificationIsDeclaredByTheInterfacecallsKeyPartTest::testDeriveKeyPartIsDeclaredByTheInterfacecallsTableElementTest::testDeriveElementIsDeclaredByTheInterfacecalls