Bug #109146 Error in using bitwise operators with strings containing newlines
Submitted: 20 Nov 2022 4:01 Modified: 22 Nov 2022 7:04
Reporter: Chenglin Tian Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:8.0.31, 5.7.40 OS:Ubuntu
Assigned to: CPU Architecture:x86

[20 Nov 2022 4:01] Chenglin Tian
When a string contains a new line character, it will be inconsistent with the expectation when used with the bit operators&, |. We think this is an error in the processing of the string by the new line character

How to repeat:
For! Operator, its operation is OK, but the bitwise&and bitwise | operations are inconsistent with expectations in the following test cases
SELECT  ! '\n1'     -- expected: 0, actual: 0

SELECT  '\n1' & 1 -- expected: 1, actual: 0  
SELECT  '\n1' | 0  -- expected: 1, actual: 0   

Suggested fix:
In terms of bitwise calculation operators, we found many inconformities with the expected results. Maybe we need to correct some errors about these operators
[21 Nov 2022 5:27] MySQL Verification Team
Hello Chenglin Tian,

Thank you for the report.

[22 Nov 2022 7:04] Tor Didriksen
Duplicate of