mod_storage_sql: Fix use of SQLite3 in-memory database (no path expansion)
authorKim Alvefur <zash@zash.se>
Tue, 15 Dec 2015 12:15:30 +0000 (13:15 +0100)
committerKim Alvefur <zash@zash.se>
Tue, 15 Dec 2015 12:15:30 +0000 (13:15 +0100)
plugins/mod_storage_sql.lua

index adf9f9b6a50d5282b6c0d6e717d472419e7827ff..57d964e277b2a160411c8c5b882b5bfeb4f357dd 100644 (file)
@@ -417,7 +417,9 @@ end
 
 local function normalize_params(params)
        if params.driver == "SQLite3" then
-               params.database = resolve_relative_path(prosody.paths.data or ".", params.database or "prosody.sqlite");
+               if params.database ~= ":memory:" then
+                       params.database = resolve_relative_path(prosody.paths.data or ".", params.database or "prosody.sqlite");
+               end
        end
        assert(params.driver and params.database, "Configuration error: Both the SQL driver and the database need to be specified");
        return params;