From e6d73972a1d4f31262d0eec6de3dcd4745495d21 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Wed, 2 Feb 2022 11:08:03 -0800 Subject: [PATCH] Fixed PostgreSQL exception, #3585 --- db.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db.js b/db.js index 730bb0a5..84e2b37d 100644 --- a/db.js +++ b/db.js @@ -1265,7 +1265,7 @@ module.exports.CreateDB = function (parent, func) { }; obj.GetEventsTimeRange = function (ids, domain, msgids, start, end, func) { if (ids.indexOf('*') >= 0) { - sqlDbQuery('SELECT doc FROM events WHERE ((domain = $1) AND (time BETWEEN $2 AND ?)) ORDER BY time', [domain, start, end], func); + sqlDbQuery('SELECT doc FROM events WHERE ((domain = $1) AND (time BETWEEN $2 AND $3)) ORDER BY time', [domain, start, end], func); } else { sqlDbQuery('SELECT doc FROM events JOIN eventids ON id = fkid WHERE ((domain = $1) AND (target = ANY ($2)) AND (time BETWEEN $3 AND $4)) GROUP BY id ORDER BY time', [domain, ids, start, end], func); }