| Bug #69355 | conv() overflow without warning | ||
|---|---|---|---|
| Submitted: | 30 May 2013 18:28 | Modified: | 28 Jan 2014 23:22 |
| Reporter: | Mike Griffin | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: Errors | Severity: | S4 (Feature request) |
| Version: | 5.6.15 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | conv, overflow | ||
[11 Aug 2013 14:36]
MySQL Verification Team
Thank you for the report.
mysql> select conv('ffffffffffffffffff',16,10);
+----------------------------------+
| conv('ffffffffffffffffff',16,10) |
+----------------------------------+
| 18446744073709551615 |
+----------------------------------+
1 row in set (0.00 sec)
mysql> select conv('fffffffffffffffffff',16,10);
+-----------------------------------+
| conv('fffffffffffffffffff',16,10) |
+-----------------------------------+
| 18446744073709551615 |
+-----------------------------------+
1 row in set (0.01 sec)

Description: The conv() function will not warn you when you have overflowed BIGINT UNSIGNED How to repeat: mysql> select conv(md5(concat("1")),16,10); +------------------------------+ | conv(md5(concat("1")),16,10) | +------------------------------+ | 18446744073709551615 | +------------------------------+ 1 row in set (0.00 sec) mysql> select conv(md5(concat("2")),16,10); +------------------------------+ | conv(md5(concat("2")),16,10) | +------------------------------+ | 18446744073709551615 | +------------------------------+ 1 row in set (0.00 sec) Suggested fix: Issue a warning when you have overflowed using the conv() function