aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_storage_sql.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-02-21 23:00:44 +0100
committerKim Alvefur <zash@zash.se>2020-02-21 23:00:44 +0100
commit79d2e2b8adaa0e556ef367ac8b486f199ad0c3b9 (patch)
tree3af3bdf24ef8e99460aaf7fad0ae994ef6d61e99 /plugins/mod_storage_sql.lua
parenta64d9f4b583de296dc762a91215342fe03990300 (diff)
downloadprosody-79d2e2b8adaa0e556ef367ac8b486f199ad0c3b9.tar.gz
prosody-79d2e2b8adaa0e556ef367ac8b486f199ad0c3b9.zip
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
Diffstat (limited to 'plugins/mod_storage_sql.lua')
-rw-r--r--plugins/mod_storage_sql.lua14
1 files 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