Hi Gaspar,
The following command returns recommended type FLOAT(3,6) for a
double(10,6) column:
mysql CAT -t -u catadmin -p -e \
"select * from temp procedure analyse(16,8192)" > temp.log
Optimal_fieldtype = FLOAT(3,6) NOT NULL.
The trouble is that FLOAT(3,6) does not make sense, with FLOAT(M,D),
M > D+2 should hold.
Is procedure analyse(16,8192) old? Or I am doing sth wrong?
I have MySQL 5.0.22 under FC3 Linux on AMD64bit.
Looks like a bug. The code in question is:
>>>>>
if (num_info.dval > -FLT_MAX && num_info.dval < FLT_MAX)
sprintf(buff, "FLOAT(%d,%d)", num_info.integers,
num_info.decimals);
else
sprintf(buff, "DOUBLE(%d,%d)", num_info.integers,
num_info.decimals);
<<<<<
It should likely use num_info.integers+num_info.decimals for the M.
Regards,
Jeremy
--
Jeremy Cole
MySQL Geek, Yahoo! Inc.
Desk: 408 349 5104
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]