Skip to content

Commit 26a0188

Browse files
committed
ユーザー名の大文字小文字を区別しないようにした
1 parent 1e75a31 commit 26a0188

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

atcoder-problems-backend/sql-client/src/language_count.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl LanguageCountClient for PgPool {
150150
let count = sqlx::query_as(
151151
r"
152152
SELECT user_id, simplified_language, problem_count FROM language_count
153-
WHERE user_id = $1
153+
WHERE LOWER(user_id) = LOWER($1)
154154
ORDER BY simplified_language
155155
",
156156
)
@@ -171,7 +171,7 @@ impl LanguageCountClient for PgPool {
171171
OVER(PARTITION BY simplified_language ORDER BY problem_count DESC) AS rank
172172
FROM language_count
173173
)
174-
AS s2 WHERE user_id = $1
174+
AS s2 WHERE LOWER(user_id) = LOWER($1)
175175
ORDER BY simplified_language
176176
",
177177
)

atcoder-problems-backend/sql-client/src/submission_client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl SubmissionClient for PgPool {
121121
r"
122122
SELECT * FROM submissions
123123
WHERE result = 'AC'
124-
AND user_id = ANY($1)
124+
AND LOWER(user_id) = ANY($1)
125125
",
126126
)
127127
.bind(user_ids)
@@ -163,7 +163,7 @@ impl SubmissionClient for PgPool {
163163
} => sqlx::query_as(
164164
r"
165165
SELECT * FROM submissions
166-
WHERE user_id = ANY($1)
166+
WHERE LOWER(user_id) = ANY($1)
167167
AND problem_id = ANY($2)
168168
AND epoch_second >= $3
169169
AND epoch_second <= $4

0 commit comments

Comments
 (0)