Skip to content

Commit

Permalink
Update judge_client.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
zhblue authored Feb 9, 2025
1 parent 256adc9 commit 96fb03c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trunk/core/judge_client/judge_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1364,12 +1364,12 @@ void _update_user_mysql(char *user_id)
char e_user_id[BUFFER_SIZE/2];
mysql_real_escape_string(conn, e_user_id, user_id, strlen(user_id));
sprintf(sql,
"UPDATE `users` SET `solved`=(SELECT count(DISTINCT `problem_id`) FROM `solution` s where s.`user_id`=\'%s\' AND s.`result`=4 and problem_id>0 and problem_id not in(select problem_id from contest_problem where contest_id in (select contest_id from contest where contest_type & 20 > 0)) ) WHERE `user_id`=\'%s\'",
"UPDATE `users` SET `solved`=(SELECT count(DISTINCT `problem_id`) FROM `solution` s where s.`user_id`=\'%s\' AND s.`result`=4 and problem_id>0 and problem_id not in(select problem_id from contest_problem where contest_id in (select contest_id from contest where contest_type & 20 > 0 and end_time>now() )) ) WHERE `user_id`=\'%s\'",
e_user_id, e_user_id);
if (mysql_real_query(conn, sql, strlen(sql)))
write_log(mysql_error(conn));
sprintf(sql,
"UPDATE `users` SET `submit`=(SELECT count(DISTINCT `problem_id`) FROM `solution` s where s.`user_id`=\'%s\' and problem_id>0 and problem_id not in(select problem_id from contest_problem where contest_id in (select contest_id from contest where contest_type & 20 > 0)) ) WHERE `user_id`=\'%s\'",
"UPDATE `users` SET `submit`=(SELECT count(DISTINCT `problem_id`) FROM `solution` s where s.`user_id`=\'%s\' and problem_id>0 and problem_id not in(select problem_id from contest_problem where contest_id in (select contest_id from contest where contest_type & 20 > 0 and end_time>now() )) ) WHERE `user_id`=\'%s\'",
e_user_id, e_user_id);
if (mysql_real_query(conn, sql, strlen(sql)))
write_log(mysql_error(conn));
Expand Down

0 comments on commit 96fb03c

Please sign in to comment.