Details
Description
The first syntax is ok, the latter 2 issue warnings:
MariaDB [(none)]> \W
Show warnings enabled.
MariaDB [(none)]> SELECT CAST(0xAA AS UNSIGNED), CAST(x'aa' AS UNSIGNED), CAST(X'aa' AS UNSIGNED);
+------------------------+-------------------------+-------------------------+
| CAST(0xAA AS UNSIGNED) | CAST(x'aa' AS UNSIGNED) | CAST(X'aa' AS UNSIGNED) |
+------------------------+-------------------------+-------------------------+
| 170 | 0 | 0 |
+------------------------+-------------------------+-------------------------+
1 row in set, 2 warnings (0.00 sec)
Warning (Code 1292): Truncated incorrect INTEGER value: '\xAA'
Warning (Code 1292): Truncated incorrect INTEGER value: '\xAA'
But based on MySQL docs, these syntaxes should be equivalent:
https://dev.mysql.com/doc/refman/5.6/en/hexadecimal-literals.html
Sorry, I didn't try this on MySQL or on older Maria versions.
Gliffy Diagrams
Attachments
Issue Links
- relates to
-
MDEV-5770 Inconsistency between string and hex warning representation when converting from string to the other types
-
- Open
-
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
Not reproducible on 5.1-5.3, MySQL 5.5 / 5.6.
It might be the same as MDEV-5770 or related to it.