]> jfr.im git - irc/quakenet/newserv.git/commitdiff
a4stats: Fix getuserrelations query.
authorGunnar Beutner <redacted>
Mon, 10 Mar 2014 05:37:25 +0000 (06:37 +0100)
committerGunnar Beutner <redacted>
Mon, 10 Mar 2014 05:37:25 +0000 (06:37 +0100)
a4stats/nterfacer_a4stats.c

index cf45e95babb39010ffeb3bde417f8081180153bf..ab714accf3d07e5b0c2c1d47b7b3e7b5be045735 100644 (file)
@@ -127,7 +127,7 @@ static int handle_getuserrelations(struct rline *ri, int argc, char **argv) {
                                "LEFT JOIN ? ON relations.channelid = channels.id " \
                                "LEFT JOIN ? AS ufirst ON (ufirst.channelid = channels.id AND relations.firstid = ufirst.accountid AND relations.first = ufirst.account) " \
                                "LEFT JOIN ? AS usecond ON (usecond.channelid = channels.id AND relations.secondid = usecond.accountid AND relations.second = usecond.account) " \
-                               "WHERE channels.name = ? " b " ORDER BY score DESC LIMIT 10"
+                               "WHERE channels.name = ? AND " b " ORDER BY score DESC LIMIT 10"
   /*
     Possible cases:
     accountid = 0, account = "username" -> new-style account, look up latest account for user