Skip to content
Tags

,

MySql 5.0 Unsigned Integer Underflow

August 1, 2008

This is tested on MySql 5.0.60-r1 (gentoo portage).

mysql> system uname -a
Linux meepo 2.6.24-hardened-r3 #11 Mon Jul 28 07:31:20 MYT 2008 i686 AMD Sempron(tm) 2200+ AuthenticAMD GNU/Linux
mysql> SELECT VERSION();
+------------+
| VERSION()  |
+------------+
| 5.0.60-log |
+------------+
1 row in set (0.00 sec)

mysql> system uname -a
Linux gentoo 2.6.24-hardened-r3 #11 Mon Jul 28 07:31:20 MYT 2008 i686 AMD Sempron(tm) 2200+ AuthenticAMD GNU/Linux
mysql> SELECT CAST( -1 AS UNSIGNED );
+------------------------+
| CAST( -1 AS UNSIGNED ) |
+------------------------+
|   18446744073709551615 |
+------------------------+
1 row in set (0.00 sec)

mysql> SELECT CAST( 0 AS UNSIGNED ) - 1;
+---------------------------+
| CAST( 0 AS UNSIGNED ) - 1 |
+---------------------------+
|      18446744073709551615 |
+---------------------------+
1 row in set (0.00 sec)

mysql>

It is expected that any negative unsigned value to be “casted” to 0.

I have filed a bug report at bugs.mysql.com
http://bugs.mysql.com/bug.php?id=38512

Edit:
Its now fixed and closed. They introduced a strict mode instead of rounding the value to 0. You should upgrade your MySql now.

Advertisements

From → Uncategorized

One Comment
  1. Skype has established its internet-structured buyer beta for the world, right after introducing it
    generally in the Usa and You.K. earlier this four weeks.

    Skype for Online also now works with Linux and Chromebook for instant text messaging interaction (no video and voice however, all those demand a plug-in installing).

    The expansion from the beta provides help for an extended
    listing of dialects to help you reinforce that global usability

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: