Commit e22073ab authored by Julien Schröter's avatar Julien Schröter

Select count of distinct pools when validating common pools

parent c6332b15
Pipeline #1635 passed with stages
in 12 minutes and 23 seconds
......@@ -783,7 +783,7 @@ func (m *MySQLDuelQuery) SetPool(duelID, poolID, userID uint32) (*schemas.DuelSc
user2 := duel.Participants[1].ID
// Check if selected pool exists
pool := db.QueryRow("SELECT COUNT(`user`) FROM `user_pool` WHERE `pool`=? AND (`user`=? OR `user`=?)", poolID, user1, user2)
pool := db.QueryRow("SELECT COUNT(DISTINCT `user`) FROM `user_pool` WHERE `pool`=? AND (`user`=? OR `user`=?)", poolID, user1, user2)
var c uint32
if err := pool.Scan(&c); err != nil || c != 2 {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment