aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_storage_sql.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-02-20 01:46:54 +0100
committerKim Alvefur <zash@zash.se>2017-02-20 01:46:54 +0100
commit50992abb107c557eea8ec203d17d085bfc3bc68c (patch)
treebe7c0181ec8542e0a1056c284cc24ca66e36b9e4 /plugins/mod_storage_sql.lua
parentf21bbbab6037681ce1496c47213661ad6465a775 (diff)
parentef1b01c822a6835cd3567885ceba78c7f42d83f7 (diff)
downloadprosody-50992abb107c557eea8ec203d17d085bfc3bc68c.tar.gz
prosody-50992abb107c557eea8ec203d17d085bfc3bc68c.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_storage_sql.lua')
-rw-r--r--plugins/mod_storage_sql.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua
index dcb00dd6..61c2a8a8 100644
--- a/plugins/mod_storage_sql.lua
+++ b/plugins/mod_storage_sql.lua
@@ -187,7 +187,7 @@ function archive_store:append(username, key, value, when, with)
when, with, value = value, when, with;
end
local user,store = username,self.store;
- return engine:transaction(function()
+ local ok, key = engine:transaction(function()
if key then
engine:delete("DELETE FROM `prosodyarchive` WHERE `host`=? AND `user`=? AND `store`=? AND `key`=?", host, user or "", store, key);
else
@@ -197,6 +197,8 @@ function archive_store:append(username, key, value, when, with)
engine:insert("INSERT INTO `prosodyarchive` (`host`, `user`, `store`, `when`, `with`, `key`, `type`, `value`) VALUES (?,?,?,?,?,?,?,?)", host, user or "", store, when, with, key, t, value);
return key;
end);
+ if not ok then return ok, key; end
+ return key;
end
-- Helpers for building the WHERE clause