diff options
author | Kim Alvefur <zash@zash.se> | 2017-01-24 19:26:40 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-01-24 19:26:40 +0100 |
commit | a4370a9db89edafd2bbe54e59644f36db49ce07d (patch) | |
tree | e9ac24608601e57c365de8cc0f7090caf347c333 | |
parent | ffde63fe687f5ffecf5fdec28358d1774a8a7169 (diff) | |
download | prosody-a4370a9db89edafd2bbe54e59644f36db49ce07d.tar.gz prosody-a4370a9db89edafd2bbe54e59644f36db49ce07d.zip |
mod_storage_sql: Fix to use correct order for return values from transaction (thanks postblue)
-rw-r--r-- | plugins/mod_storage_sql.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua index a79f30fc..07ff4c27 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; - local stmt, err = engine:transaction(function() + local ok, stmt = engine:transaction(function() local sql_query = "DELETE FROM `prosodyarchive` WHERE %s;"; local args = { host, user or "", store, }; local where = { "`host` = ?", "`user` = ?", "`store` = ?", }; @@ -300,7 +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; + return ok and stmt:affected(), stmt; end local stores = { |