this query should not find bonks, which later causes crashes.

thanks benjojo
This commit is contained in:
Ted Unangst 2023-07-15 18:03:47 -04:00
parent 211ab9a97a
commit 54fd484558
1 changed files with 1 additions and 1 deletions

View File

@ -1149,7 +1149,7 @@ func prepareStatements(db *sql.DB) {
smalllimit := " order by honks.honkid desc limit ?" 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)" 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 = ?") 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") 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) stmtPublicHonks = preparetodie(db, selecthonks+"where whofore = 2 and dt > ?"+smalllimit)
stmtEventHonks = preparetodie(db, selecthonks+"where (whofore = 2 or honks.userid = ?) and what = 'event'"+smalllimit) stmtEventHonks = preparetodie(db, selecthonks+"where (whofore = 2 or honks.userid = ?) and what = 'event'"+smalllimit)