Fixing histogram on mysql.