Available in versions: Dev (3.20) | Latest (3.19) | 3.18

Trivial bitwise operations

Applies to ✅ Open Source Edition   ✅ Express Edition   ✅ Professional Edition   ✅ Enterprise Edition

bitwise operations can be trivial, in case of which the expression can be removed and replaced by one of the arguments.

Using Settings.transformPatternsTrivialBitwiseOperations, the following transformations can be achieved:

-- With Settings.transformPatternsTrivialBitwiseOperations active, this:
SELECT
  bitor(a, 0),
  bitand(a, -1),
  bitxor(a, 0),
  bitxor(a, -1)
  -- and many more
FROM tab;

-- ... is transformed into the equivalent expression:
SELECT
  a,        -- bitor(a, 0),
  a,        -- bitand(a, -1),
  a,        -- bitxor(a, 0),
  bitnot(a) -- bitxor(a, -1)
  -- and many more
FROM tab;

Feedback

Do you have any feedback about this page? We'd love to hear it!

The jOOQ Logo