Commit 120691eb authored by Frederik Wegner's avatar Frederik Wegner

Fixed bug in patch duel pool, user pool intersection check

parent 8d96f399
Pipeline #1654 passed with stage
in 4 minutes and 30 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(DISTINCT `user`) FROM `user_pool` WHERE `pool`=? AND (`user`=? OR `user`=?)", poolID, user1, user2)
pool := db.QueryRow("SELECT COUNT(*) FROM ((SELECT `user` FROM `user_pool` WHERE `pool`=? AND `user`=?) UNION (SELECT `user` FROM `user_pool` WHERE `pool`=? AND `user`=?)) AS Q", poolID, user1, poolID, 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