>>>>> "takeshi" == takeshi <takeshi@stripped> writes:
takeshi> At Tue, 6 Jul 1999 14:07:56 +0100,
takeshi> Franck ZIMMER <fzimmer@stripped> wrote:
>>
>> I tried to install MySql version 3.22.14, 3.22.23b on the Qube 2 (mips).
>> Linux code name fargo kernel 2.0.34
>> (Compiled with gcc 2.7.2)
>>
>> The installation seems to work.
>> But if I try the sql functions MAX(), MIN() and AVG(), each functions brings the
>> result 0.
takeshi> me too. I got `0'.
takeshi> and, numeric values are broken.
>> How-To-Repeat:
takeshi> [root@cube /root]# mysql test
mysql> create table a (a int, d double);
mysql> insert into a values (30, 20.0);
mysql> insert into a values (123, 67.23);
mysql> insert into a values (10, 45.098);
mysql> select * from a;
takeshi>
> +------+----------------------------------------------------------------------------------------------+
takeshi> | a | d
> |
takeshi>
> +------+----------------------------------------------------------------------------------------------+
takeshi> | 30 |
> 0.0000 |
takeshi> | 123 |
> 427698049712232164500227837098811565868386169064859043663724062914674140928483763683328.0000
> |
takeshi> | 10 |
> 387381585965481984.0000 |
takeshi>
> +------+----------------------------------------------------------------------------------------------+
takeshi> 3 rows in set (0.00 sec)
<cut>
Hi!
I don't have access to a mips computer; Any change you can debug
this?
The bug should be in this functions: (sql/field.cc):
void Field_double::store(double nr)
{
if (decimals != 31)
nr=floor(nr*log_10[decimals]+0.5)/log_10[decimals]; // To fixed point
doublestore(ptr,nr);
}
double Field_double::val_real(void)
{
double j; doubleget(j,ptr);
return j;
}
The doublestore / doubleget macros are defined in include/global.h
Note that this *could* be a bug in gcc 2.7
Regards,
Monty