Fix incorrect clearing of visit history

This commit is contained in:
calzoneman 2013-06-19 22:40:23 -04:00
parent 08dabeda59
commit 55e6734bd1
1 changed files with 2 additions and 2 deletions

View File

@ -923,12 +923,12 @@ function recordVisit(ip, name) {
// Keep most recent 5 records per IP
results = db.querySync(createQuery(
["DELETE FROM aliases WHERE visit_id NOT IN (",
["DELETE FROM aliases WHERE ip=? AND visit_id NOT IN (",
"SELECT visit_id FROM (",
"SELECT visit_id,time FROM aliases WHERE ip=? ORDER BY time DESC LIMIT 5",
") foo",
");"].join(""),
[ip]
[ip, ip]
));
return results;