From 84e0c87b7e165f58f8061ad92c73dddc100cee23 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 21 Feb 2020 23:00:44 +0100 Subject: mod_storage_sql: Fix check for deletion limits (fixes #1494) The check was only performed if sql_manage_tables was set to true (the default) It should always be performed --- plugins/mod_storage_sql.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua index a449091e..a9298138 100644 --- a/plugins/mod_storage_sql.lua +++ b/plugins/mod_storage_sql.lua @@ -622,15 +622,15 @@ function module.load() module:log("error", "Old database format detected. Please run: prosodyctl mod_%s upgrade", module.name); return false, "database upgrade needed"; end - if engine.params.driver == "SQLite3" then - for row in engine:select("PRAGMA compile_options") do - if row[1] == "ENABLE_UPDATE_DELETE_LIMIT" then - engine._have_delete_limit = true; - end - end - end end end); + if engine.params.driver == "SQLite3" then + for row in engine:select("PRAGMA compile_options") do + if row[1] == "ENABLE_UPDATE_DELETE_LIMIT" then + engine._have_delete_limit = true; + end + end + end engines[sql.db2uri(params)] = engine; end -- cgit v1.2.3