List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:September 1 1999 10:41pm
Subject:Select max reports NaN
View as plain text  
>>>>> "Nicolas" == Nicolas Ross <junk@stripped> writes:

Nicolas> I hope this is the place to get help on this issue !
Nicolas> Here's some output, explains will follow.

mysql> select max(userid) from carnet2;
Nicolas> +-------------+
Nicolas> | max(userid) |
Nicolas> +-------------+
Nicolas> |         NaN |
Nicolas> +-------------+
Nicolas> 1 row in set (0.02 sec)

mysql> select max(userid) from carnet;
Nicolas> +-------------+
Nicolas> | max(userid) |
Nicolas> +-------------+
Nicolas> |          10 |
Nicolas> +-------------+
Nicolas> 1 row in set (0.03 sec)

mysql> select max(userid)+1 from carnet2;
Nicolas> +----------------------+
Nicolas> | max(userid)+1        |
Nicolas> +----------------------+
Nicolas> | -9223372036854775807 |
Nicolas> +----------------------+
Nicolas> 1 row in set (0.02 sec)

mysql> select max(userid)+1 from carnet;
Nicolas> +---------------+
Nicolas> | max(userid)+1 |
Nicolas> +---------------+
Nicolas> |            11 |
Nicolas> +---------------+
Nicolas> 1 row in set (0.07 sec)

Nicolas> Here's the create syntax :

<cut>

Nicolas> This is done on our web hosting server (at verser.com) on BSD/OS 3.0 w/
Nicolas> Virtual Kernel, mysql 3.22.14b-gamma-virtual. I do my developement on a
Nicolas> Red Hat Linux 5.2 box w/ Mysql 3.22.23 and the problem don't show up.

Nicolas> I searched for this in the documentation and mailing list archives, but
Nicolas> with no success.

Nicolas> Beside upgrading, is there another solution ?

Hi!

Sorry, no.  This seams to be a bug in how MySQL optimizes MAX() in
this particular version.  I suggest they upgrade to 3.22.25, the
current stable MySQL 3.22 version.

Regards,
Monty
Thread
Select max reports NaNNicolas Ross1 Sep
  • Select max reports NaNMichael Widenius2 Sep