数据类型转换错误
出现这个Bug的原因是MySQL在执行sum操作之后返回的数据类型不一样,不同版本的MySQL返回的数据类型不一样,可能有 string,integer,long型等, 更多情况下面
The SUM() and AVG() functions return a DECIMAL value for exact-value arguments (integer or DECIMAL), and a DOUBLE value for approximate-value arguments (FLOAT or DOUBLE). (Before MySQL 5.0.3, SUM() and AVG() return DOUBLE for all numeric arguments.)
我的解决办法:
在不影响效果的前提下 注释掉//total += (Long) array[0];