# HG changeset patch # User Kim Alvefur # Date 1588421582 -7200 # Node ID 9ce67da45e546415c741e557bd26fb0e885ff8f3 # Parent ef2bd183f6608f111953d3060cb73a23a715133b 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. diff -r ef2bd183f660 -r 9ce67da45e54 plugins/mod_storage_sql.lua --- a/plugins/mod_storage_sql.lua Wed Apr 29 23:28:21 2020 +0200 +++ b/plugins/mod_storage_sql.lua Sat May 02 14:13:02 2020 +0200 @@ -759,9 +759,10 @@ 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)