Changeset

7008:9beba2572e2b

mod_storage_sql: Fix use of SQLite3 in-memory database (no path expansion)
author Kim Alvefur <zash@zash.se>
date Tue, 15 Dec 2015 13:15:30 +0100
parents 7004:ddb03cc4ce04
children 7009:61f5f8435e0b
files plugins/mod_storage_sql.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_storage_sql.lua	Sun Dec 13 21:21:09 2015 +0100
+++ b/plugins/mod_storage_sql.lua	Tue Dec 15 13:15:30 2015 +0100
@@ -417,7 +417,9 @@
 
 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;