mini\Database\VirtualDatabase::trySimplifyArithmeticComparison() Method

private

Signature

private function trySimplifyArithmeticComparison(mini\Parsing\SQL\AST\BinaryOperation $node): ?array

Parameters

Name Type Default Description
$node mini\Parsing\SQL\AST\BinaryOperation required Documentation missing

Returns

?array

Documentation

Try to simplify arithmetic comparison to pushable form

Handles patterns like:

  • (col + 5) > 7 → col > 2
  • (col - 3) >= 10 → col >= 13
  • (5 + col) < 10 → col < 5
  • (10 - col) > 3 → col < 7 (operator flips!)
  • (col * 2) > 10 → col > 5
  • (col / 2) >= 5 → col >= 10

Source

src/Database/VirtualDatabase.php:4553-4594