aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-11-22 18:13:21 +0100
committerKim Alvefur <zash@zash.se>2016-11-22 18:13:21 +0100
commitad82f3f080f18af21be4bb5b30ac0101688d9886 (patch)
treea92f8f80cbcfd318f907ff1f56b213dc822af52c /plugins
parent34cb7607de0569c26dd36cd23cdd46d4e818b517 (diff)
downloadprosody-ad82f3f080f18af21be4bb5b30ac0101688d9886.tar.gz
prosody-ad82f3f080f18af21be4bb5b30ac0101688d9886.zip
mod_storage_sql: Return number of affected items from archive:delete
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_storage_sql.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua
index 819846bb..a79f30fc 100644
--- a/plugins/mod_storage_sql.lua
+++ b/plugins/mod_storage_sql.lua
@@ -287,7 +287,7 @@ end
function archive_store:delete(username, query)
query = query or {};
local user,store = username,self.store;
- return engine:transaction(function()
+ local stmt, err = engine:transaction(function()
local sql_query = "DELETE FROM `prosodyarchive` WHERE %s;";
local args = { host, user or "", store, };
local where = { "`host` = ?", "`user` = ?", "`store` = ?", };
@@ -300,6 +300,7 @@ function archive_store:delete(username, query)
sql_query = sql_query:format(t_concat(where, " AND "));
return engine:delete(sql_query, unpack(args));
end);
+ return stmt and stmt:affected() or nil, err;
end
local stores = {