classNullTest
final class NullTest
implements Scalar
uses Snapshot
Public API: explicitly declared with
@visibility public.A NULL test: IS [NOT] NULL (Item_func_isnull, Item_func_isnotnull).
The test belongs to the bool_pri level, like the comparisons, and associates to the left with them.
Rule: MYSQL-NULL-TEST-001. Facts: always 1 or 0, an integer that is never NULL. A row operand is accepted (a row is NULL when every element is). Terminates: the operand is a strict part. Source: https://dev.mysql.com/doc/refman/8.4/en/comparison-operators.html#operator_is-null. Status: Implemented.
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT a FROM t WHERE a IS NOT NULL');
$query->statement->where->negated // => trueProperties§
public Scalar $operandpublic bool $negated = falseMethods§
public function __construct(public Scalar $operand, public bool $negated = false)Parameters
$operand | Scalar | The tested expression |
$negated | bool | Whether NOT is written after IS |
Calls 4
- static-call Check::input() line 45
- method-call Precedence::fits() line 45
- new Precedence line 45
- class-const Precedence::BOOL_PRI() line 45
public function deriveScalar(Derivation $derivation, Environment $environment): ScalarFactDerives the operand; the test is never NULL.
Parameters
$derivation | Derivation | |
$environment | Environment |
Returns
Calls 5
- method-call Operands::single() line 53
- new Operands line 53
- method-call Derivation::scalar() line 53
- method-call Operands::truth() line 55
- class-const Nullability::NotNull() line 55
public function render(Output $out): voidWrites the operand, IS, the optional NOT and NULL.
Parameters
$out | Output |
Test cases 1
Calls 2
- method-call Output::node() line 63
- method-call Output::keyword() line 65
Test cases 4§
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 1
Relations§
Instantiated in 2
- new SqlSemantics\Platform\MySql\Lowering\Expression\ConditionRule::apply() packages/sql-semantics-mysql/src/Lowering/Expression/ConditionRule.php:171
- new SqlSemantics\Platform\MySql\Lowering\Expression\ConditionRule::negatedNull() packages/sql-semantics-mysql/src/Lowering/Expression/ConditionRule.php:188