try
{
m_database.query("insert into " + table_name(table_users) + " (u_down_total, u_up_total, " + column_name(column_users_uid) + ", u_up_release, u_up_bonus, max_up_speed, max_down_speed) values "
+ m_users_updates_buffer
+ " on duplicate key update"
+ " u_down_total = u_down_total + values(u_down_total),"
+ " u_up_total = u_up_total + values(u_up_total),"
+ " u_up_release = u_up_release + values(u_up_release),"
+ " u_up_bonus = u_up_bonus + values(u_up_bonus),"
+ " max_up_speed = GREATEST(max_up_speed, values(max_up_speed)),"
+ " max_down_speed = GREATEST(max_down_speed, values(max_down_speed)),"
+ " u_down_today = u_down_today + values(u_down_total),"
+ " u_up_today = u_up_today + values(u_up_total),"
+ " u_release_today = u_release_today + values(u_up_release),"
+ " u_bonus_today = u_bonus_today + values(u_up_bonus),"
+ " u_up_speed_today = GREATEST(u_up_speed_today, values(max_up_speed)),"
+ " u_down_speed_today = GREATEST(u_down_speed_today, values(max_down_speed)),"
+ " u_down_last = values(u_down_total),"
+ " u_up_last = values(u_up_total),"
+ " u_release_last = values(u_up_release),"
+ " u_bonus_last = values(u_up_bonus),"
+ " u_up_speed_last = values(max_up_speed),"
+ " u_down_speed_last = values(max_down_speed)");
}