Files
cyclingbot/db
Blake Ridgway 7b2ed64c87 Fix correlated subqueries referencing non-grouped column
Replace sub.guild_id = dl.guild_id with sub.guild_id = $1 in all
5 stats queries to satisfy PostgreSQL GROUP BY strictness.

PostgreSQL requires columns in correlated subqueries to appear in
the outer GROUP BY, but guild_id was not grouped. Since the outer
query already filters by WHERE guild_id = $1, using $1 directly
in the subquery is correct and avoids the error.

Affected: GetLeaderboard, GetUserStats, GetStatsInRange,
GetYearlyLeaderboard, GetUserYearlyStats
2026-06-10 21:14:29 -05:00
..