enumUnaryOperator
enum UnaryOperator: string
Public API: explicitly declared with
@visibility public.The prefix operators of the simple_expr level: +, -, ~ and the tight logical negation !.
Under HIGH_NOT_PRECEDENCE the keyword NOT is the tight negation and is written !. Each case holds the written operator. Source: https://dev.mysql.com/doc/refman/8.4/en/operator-precedence.html, https://dev.mysql.com/doc/refman/8.4/en/sql-mode.html#sqlmode_high_not_precedence.
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT a FROM t WHERE -a < 0');
$query->statement->where->left->operator // => \SqlSemantics\Platform\MySql\Statement\Expression\Operator\UnaryOperator::MinusCases§
case Plus = '+'case Minus = '-'case Invert = '~'case Not = '!'Test cases 9§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
Other tests reaching this symbol 8
PrimaryRuleTest::testUnitLowersTheTightNegationOfHighNotPrecedencecallsPrecedenceTest::testAdmitsAcceptsTheNonterminalsOfASlotcallsPrecedenceTest::testFitsAcceptsALeftOperandThatKeepsItsPlacecallsPrecedenceTest::testOpeningIsTheWeakestLevelOnTheLeftEdgecallsBinaryCastTest::testRenderCastsAPrefixOperandWithoutParenthesescallsUnaryTest::testAConcatenationOperandIsRejectedcallsUnaryTest::testDeriveScalarTypesEachOperatorcallsUnaryTest::testRenderNegatesACollatedOperandWithoutParenthesescalls
Relations§
Constant reads 10
- class-const SqlSemantics\Platform\MySql\Lowering\Expression\PrimaryRule packages/sql-semantics-mysql/src/Lowering/Expression/PrimaryRule.php:58
- class-const SqlSemantics\Platform\MySql\Lowering\Expression\PrimaryRule packages/sql-semantics-mysql/src/Lowering/Expression/PrimaryRule.php:58
- class-const SqlSemantics\Platform\MySql\Lowering\Expression\PrimaryRule packages/sql-semantics-mysql/src/Lowering/Expression/PrimaryRule.php:59
- class-const SqlSemantics\Platform\MySql\Lowering\Expression\PrimaryRule packages/sql-semantics-mysql/src/Lowering/Expression/PrimaryRule.php:59
- class-const SqlSemantics\Platform\MySql\Lowering\Expression\PrimaryRule::unit() packages/sql-semantics-mysql/src/Lowering/Expression/PrimaryRule.php:112
- class-const SqlSemantics\Platform\MySql\Rules\Query\ItemNaming::own() packages/sql-semantics-mysql/src/Rules/Query/ItemNaming.php:133
- class-const SqlSemantics\Platform\MySql\Statement\Expression\Operator\Unary::deriveScalar() packages/sql-semantics-mysql/src/Statement/Expression/Operator/Unary.php:60
- class-const SqlSemantics\Platform\MySql\Statement\Expression\Operator\Unary::deriveScalar() packages/sql-semantics-mysql/src/Statement/Expression/Operator/Unary.php:61
- class-const SqlSemantics\Platform\MySql\Statement\Expression\Operator\Unary::deriveScalar() packages/sql-semantics-mysql/src/Statement/Expression/Operator/Unary.php:62
- class-const SqlSemantics\Platform\MySql\Statement\Expression\Operator\Unary::deriveScalar() packages/sql-semantics-mysql/src/Statement/Expression/Operator/Unary.php:63