List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:November 23 1999 10:59am
Subject:Bug in min() function
View as plain text  
>>>>> "Frank" == Frank Oellien
> <Frank.Oellien@stripped> writes:

>> Submitter-Id: <submitter ID>
>> Originator:
>> Organization:

>> MySQL support: none
>> Synopsis: min() function returns 0.00 instead of min value
>> Severity: serious
>> Priority: high
>> Category: mysql
>> Class:  sw-bug
>> Release: mysql-3.21.15e-alpha
>> Server: /usr/local/bin/mysqladmin  Ver 7.8 Distrib 3.22.14-gamma, for
Frank> sgi-irix6.3 on mips
Frank> TCX Datakonsult AB, by Monty

Frank> Server version  3.22.14-gamma-log
Frank> Protocol version 10
Frank> Connection  Localhost via UNIX socket
Frank> UNIX socket  /tmp/mysql.sock
Frank> Uptime:   3 days 3 hours 36 min 51 sec

Frank> Threads: 2  Questions: 5837  Slow queries: 18  Opens: 316  Flush tables:
Frank> 2  Open tables: 27
>> Environment:
Frank> System: IRIX64 vermeer 6.5 04151556 IP27

Frank> Some paths:  /bin/make /usr/local/bin/gmake /usr/local/bin/gcc /bin/cc
Frank> GCC: gcc version

>> Description:
Frank>  We have a database with several tables. Each table has ca. 1.8 million
Frank> rows. One colum(logGi50) has decimal(5,3) values from -4.000 to 12.600.
Frank> SELECT*FROM gi50 WHERE logGI50<=0.0 shows that there are 14037 rows that
Frank> mach this criterion. However the command SELECT MIN(logGI50) from gi50
Frank> gives 0.000. After extracting all rows with negative logGI50 values in a
Frank> seperate table and running the MIN() function on this table (14037
Frank> rows), the correct value (-4.000) was returned. So the bug obviously
Frank> occurs only in big tables.
Frank> We also have the same database on a LINUX Server with a newer version of
Frank> MySQL (Ver 7.11 Distrib 3.22.26a, for pc-linux-gnu on i686, Server
Frank> version 3.22.26a-log). However we have the same problem with this
Frank> version. The answer is in this case -0.000.
>> How-To-Repeat:
mysql> select min(logGI50) from gi50;
Frank> +--------------+
Frank> | min(logGI50) |
Frank> +--------------+
Frank> |        0.000 |
Frank> +--------------+
Frank> 1 row in set (0.04 sec)

>> Fix:
Frank>  <how to correct or work around the problem, if known (multiple lines)>


Any way you can reproduce a table, that you can give us access to,
that shows this on Linux with the 3.22.26 version ?

If yes, please make a tar of the .frm, .ISM and .ISD files and this
mail and ftp it to 
and we will check this out.

Bug in min() functionFrank Oellien22 Nov
  • Bug in min() functionMichael Widenius23 Nov
  • Re: Bug in min() functionFrank Oellien23 Nov
    • Re: Bug in min() functionMichael Widenius24 Nov
    • Re: Bug in min() functionMichael Widenius24 Nov