| Bug #27627 | Bit-Field Values and User Variables | ||
|---|---|---|---|
| Submitted: | 3 Apr 2007 22:02 | Modified: | 13 Jul 2007 13:36 |
| Reporter: | Hakan Ensari | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
| Version: | 5.0.27, 5.1, 5.2 | OS: | Linux (GNU/Linux) |
| Assigned to: | Paul DuBois | CPU Architecture: | Any |
[3 Apr 2007 22:02]
Hakan Ensari
[4 Apr 2007 9:47]
Sveta Smirnova
Thank you for the report. Verified as described. All versions are affected.
[10 Apr 2007 12:16]
Konstantin Osipov
Tim, suggest to assign to Ramil (the implementor of bit type)
[18 Jun 2007 7:45]
Sveta Smirnova
After discussion with Ramil we agree this is not a server bug. Output of BIN(15) is treating as binary string and one should explicitly cast values if she wants to use it as number. Though this should be documented as done for Hexadecimal Values at http://dev.mysql.com/doc/refman/5.0/en/hexadecimal-values.html
[19 Jun 2007 18:24]
Timothy Smith
As a clarification, the cast must be done when selecting the value, as: set @bitter = cast(b'111' as unsigned); Once stored as a binary string, the values can't be cast to numbers in a simple way (the ill-named ASCII() function, which works just fine for values > 127, might help).
[13 Jul 2007 13:36]
Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products. Added discussion/example showing how to assign bit values as numbers to user variables: http://dev.mysql.com/doc/refman/5.0/en/bit-field-values.html http://dev.mysql.com/doc/refman/5.0/en/user-variables.html
