aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_storage_sql.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-05-02 14:13:02 +0200
committerKim Alvefur <zash@zash.se>2020-05-02 14:13:02 +0200
commit0c677709af08ba2c1c86648ccc8c1dcb8f759e27 (patch)
tree0452db4e7e5a5d111274c635099ff54c71bcf337 /plugins/mod_storage_sql.lua
parent7612c4703106d404d6cfd23a27b5a7c5e932f2cf (diff)
downloadprosody-0c677709af08ba2c1c86648ccc8c1dcb8f759e27.tar.gz
prosody-0c677709af08ba2c1c86648ccc8c1dcb8f759e27.zip
mod_storage_sql: Log database connection parameters when creating engine
This is meant to help trace down an issue where Prosody apparently creates multiple conflicting SQL engines, causing problems especially with SQLite3, e.g. #616 #784.
Diffstat (limited to 'plugins/mod_storage_sql.lua')
-rw-r--r--plugins/mod_storage_sql.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua
index 21556715..30e38d49 100644
--- a/plugins/mod_storage_sql.lua
+++ b/plugins/mod_storage_sql.lua
@@ -759,9 +759,10 @@ function module.load()
if prosody.prosodyctl then return; end
local engines = module:shared("/*/sql/connections");
local params = normalize_params(module:get_option("sql", default_params));
- engine = engines[sql.db2uri(params)];
+ local db_uri = sql.db2uri(params);
+ engine = engines[db_uri];
if not engine then
- module:log("debug", "Creating new engine");
+ module:log("debug", "Creating new engine %s", db_uri);
engine = sql:create_engine(params, function (engine) -- luacheck: ignore 431/engine
if module:get_option("sql_manage_tables", true) then
-- Automatically create table, ignore failure (table probably already exists)