We have a set of calculations that do something like
SELECT ROUND(SUM(ROUND(3*IP))/3,1) as IP_sum from ....
Say for example that IP_sum is exactly 180.
When we call from the mysql client we get 180.0 every time, but if we use the perl dbi, the result depends on IP's column type.
When IP is a decimal(7,1) we get one digit and IP_sum => '180.0' When IP is a float(7,1) we don't get any digits => IP_sum => '180'
Is anyone aware of a new change or update to the Perl DBI that might be causing this? We just updated some modules and programs this week.
Engine: Mysql 5.6, mysql client, 5.5.
FLOAT(7,1)
, well do not use(m,n)
onFLOAT
. Use eitherDECIMAL(7,1)
or plainFLOAT
in MySQL.FLOAT
. HVS has the "real answer".