From b4c2627ed50a5c8cf4e5d6f12e8e7af365ec517c Mon Sep 17 00:00:00 2001 From: Alexey Kasyanchuk Date: Tue, 15 Jun 2021 14:15:46 +0300 Subject: [PATCH] fix(db): fix order in some cases for future db structure --- src/background/forBigTable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/background/forBigTable.js b/src/background/forBigTable.js index a422051..84a6d54 100644 --- a/src/background/forBigTable.js +++ b/src/background/forBigTable.js @@ -5,7 +5,7 @@ module.exports = (sphinx, table, callback, doneCallback, max = 1000, where = '', doneCallback(true) done(true) } - const data = await sphinx.query(`SELECT * FROM ${table} WHERE id > ${index} ${where} LIMIT ${max}`); + const data = await sphinx.query(`SELECT * FROM ${table} WHERE id > ${index} ${where} ORDER BY id ASC LIMIT ${max}`); if(data.length == 0) { finish() return;