final class PredicateRule
Restricted visibility: declared "@visibility SqlSemantics\Platform\MySql". Code outside that scope must not name this declaration.

Lowers the predicate level: IN, BETWEEN, LIKE, REGEXP, SOUNDS LIKE and MEMBER OF.

Rule: MYSQL-PREDICATE-001. Scope: predicate, opt_escape (5.6, 5.7), opt_of (8.0 and later). Every form takes a bit_expr operand; NOT before the keyword is the negated form; IN (expr) keeps its single element; the optional OF of MEMBER OF is not part of the structure; RLIKE is the keyword REGEXP. Constructs: InList, InQuery, Between, Like, Regexp, SoundsLike, MemberOf. Terminates: every child is a strict subtree. Source: https://dev.mysql.com/doc/refman/8.4/en/comparison-operators.html, https://dev.mysql.com/doc/refman/8.4/en/string-comparison-functions.html. Status: Implemented.

Methods§

public function __construct(private Lowering $lowering)

Parameters

$loweringLoweringThe lowering this rule belongs to
public function operation(Form $form, Scalar $operand, int $offset): Scalar

Lowers the operation of a predicate production over its lowered operand; offset is one when NOT is written.

Parameters

$formForm
$operandScalar
$offsetint

Returns

Throws

ImplementationGap When a production has no rule
Test cases 2
Called from 1
Calls 12
public function member(Form $form, Scalar $operand): MemberOf
public function escape(Node $escape): ?Scalar

Lowers the optional ESCAPE clause of MySQL 5.6 and 5.7.

Parameters

$escapeNode

Returns

Throws

ImplementationGap When the production has no rule
Test cases 1
Called from 1
Calls 2

Private surface 2§

Implementation details, listed for orientation only.

private const NEGATED = ['predicate: bit_expr not IN_SYM ( subselect )' => 1, 'predicate: bit_expr not …
private Lowering $lowering

Test cases 5§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 5

Relations§

Instantiated in 2
Method calls 3