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 CPU Architecture:Any

[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)

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.037 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
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.