Bug #1993 bit functions do not return unsigned values
Submitted: 2 Dec 2003 3:35 Modified: 10 Dec 2003 6:41
Reporter: Masaki Fujimoto Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.16 OS:
Assigned to: Konstantin Osipov

[2 Dec 2003 3:35] Masaki Fujimoto
Description:
The manual (6.3.6.1 Bit Functions) says that "^"(XOR) and ">>"(bit shift) return *unsigned* 64 bit value but it seems that they still return *signed* 64 bit value in some occasion.

How to repeat:
Following two sqls are typical ones:

mysql> SELECT -1>>0;
+-------+
| -1>>0 |
+-------+
|    -1 |
+-------+

mysql> SELECT -1^1;
+------+
| -1^1 |
+------+
|   -2 |
+------+
[10 Dec 2003 6:41] Konstantin Osipov
Fixed in 4.0.17: bk commit - 4.0 tree (konstantin:1.1634)