Bug #10585 Bit function does not work on variables with binary values.
Submitted: 12 May 2005 11:08 Modified: 13 May 2005 8:43
Reporter: Disha Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.5 Beta OS:Windows (Windows 2000 Server)
Assigned to: CPU Architecture:Any

[12 May 2005 11:08] Disha
Description:
Bit function does not work on variables with binary values, though actual binary values work properly.

How to repeat:
1. Start the MySQL client and connect to the database with valid user and password.
2. Set the delimiter to //
3. Create two variables with binary values and two variables with non binary values:
   set @a=b'1'//
   set @b=b'0'//
   set @c=1//
   set @d=0//

4. Now execute bit function '&' as follows:
   select (b'1'|b'0')//
   select (@a|@b)//
   select (@c|@d)//

Expected Results: 
1. The output of all commands should be same.

Actual Results: 
1. The command using variables with binary values fails. The command output for all commands is as follows:

   mysql> select (b'1'|b'0')//
   +-------------+
   | (b'1'|b'0') |
   +-------------+
   |           1 |
   +-------------+
   1 row in set (0.00 sec)
   mysql> select (@a|@b)//
   +---------+
   | (@a|@b) |
   +---------+
   |       0 |
   +---------+
   1 row in set (0.00 sec)
   mysql> select (@c|@d)//
   +---------+
   | (@c|@d) |
   +---------+
   |       1 |
   +---------+
   1 row in set (0.00 sec)
   
Additional information: Similar behavior is observed for '&' function also.
[12 May 2005 11:50] MySQL Verification Team
Verified on Linux.
[13 May 2005 8:43] Sergei Golubchik
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

see bug#10577