From 54fd4845589fa8289a90edc7b0056484a73edf8b Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Sat, 15 Jul 2023 18:03:47 -0400 Subject: [PATCH] this query should not find bonks, which later causes crashes. thanks benjojo --- database.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database.go b/database.go index 44a420b..28e42f2 100644 --- a/database.go +++ b/database.go @@ -1149,7 +1149,7 @@ func prepareStatements(db *sql.DB) { smalllimit := " order by honks.honkid desc limit ?" butnotthose := " and convoy not in (select name from zonkers where userid = ? and wherefore = 'zonvoy' order by zonkerid desc limit 100)" stmtOneXonk = preparetodie(db, selecthonks+"where honks.userid = ? and xid = ?") - stmtAnyXonk = preparetodie(db, selecthonks+"where xid = ? order by honks.honkid asc") + stmtAnyXonk = preparetodie(db, selecthonks+"where xid = ? and what <> 'bonk' order by honks.honkid asc") stmtOneBonk = preparetodie(db, selecthonks+"where honks.userid = ? and xid = ? and what = 'bonk' and whofore = 2") stmtPublicHonks = preparetodie(db, selecthonks+"where whofore = 2 and dt > ?"+smalllimit) stmtEventHonks = preparetodie(db, selecthonks+"where (whofore = 2 or honks.userid = ?) and what = 'event'"+smalllimit)