aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2012-07-30 06:01:41 +0200
committerKim Alvefur <zash@zash.se>2012-07-30 06:01:41 +0200
commit7d6a3f2438b72078d6d5ffad8f6f4ed41e144136 (patch)
tree9cdac4bf20bd3c0af72e4cfaf1cb88aeb7d7d3ae
parent3496e5281e28c5b17c2074de2b83225213edceb5 (diff)
downloadprosody-7d6a3f2438b72078d6d5ffad8f6f4ed41e144136.tar.gz
prosody-7d6a3f2438b72078d6d5ffad8f6f4ed41e144136.zip
mod_storage_sql: Complete transactions in list_stores and purge
-rw-r--r--plugins/mod_storage_sql.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua
index c5a711bc..c20e4473 100644
--- a/plugins/mod_storage_sql.lua
+++ b/plugins/mod_storage_sql.lua
@@ -383,21 +383,21 @@ function driver:list_stores(username) -- Not to be confused with the list store
end
local stmt, err = dosql(sql, host, username);
if not stmt then
- return nil, err;
+ return rollback(nil, err);
end
local stores = {};
for row in stmt:rows() do
stores[#stores+1] = row[1];
end
- return stores;
+ return commit(stores);
end
function driver:purge(username)
local stmt, err = dosql("DELETE FROM `prosody` WHERE `host`=? AND `user`=?", host, username);
- if not stmt then return stmt, err; end
+ if not stmt then return rollback(stmt, err); end
local changed, err = stmt:affected();
- if not changed then return changed, err; end
- return true, changed;
+ if not changed then return rollback(changed, err); end
+ return commit(true, changed);
end
module:add_item("data-driver", driver);