fix Mysql sum return integer instead of float

This PR fix a wrong conversion to integer in sum
calculation when the table name is included in
the fied of sum.

Fixes #12937.

  Before:

      Account.sum("2.1 * accounts.credit_limit") => 667

  After:

      Account.sum("2.1 * accounts.credit_limit") => 667.8