Bitwise OR failed, bit 5 not set
I discovered a problem using the bitwise operation in MySQL WorkBench 6.1.6.11834 build 1642.
I came across it by accident when I did not get the expected result.
It appears that when you use bitwise operations, that bit 5 is masked for some reason. Documentation shows that the bitwise operation supports 64 bits.
So far I have not been able to figure out why this might be happening.
I have not yet found any bug-reports about this.
How to repeat:
SELECT 20000 | 2; result is 20002 OK
SELECT 20000 | 4; result is 20004 OK
SELECT 20000 | 8; result is 20008 OK
SELECT 20000 | 31; result is 20031 OK
SELECT 20000 | 32; result is 20000 NOT OK, Bit 5 not set, should be 20032
SELECT 20000 | 33; result is 20001 NOT OK, Bit 5 not set, should be 20033
SELECT 20000 | 34; result is 20002 NOT OK, Bit 5 not set, should be 20034
SELECT 20000 | 63; result is 20031 NOT OK, Bit 5 not set, should be 20063
SELECT 20000 | 64; result is 20064 OK
Subject
Written By
Posted
Bitwise OR failed, bit 5 not set
September 15, 2014 02:01PM
September 15, 2014 02:58PM
September 15, 2014 04:07PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.