# HG changeset patch # User Kim Alvefur # Date 1485282400 -3600 # Node ID 14fe60a65c69468b363bcad9abcbd0dded2a7f28 # Parent bd5008a7dcbdc49bcde9d4b3b5b94ce7dc5f688e mod_storage_sql: Fix to use correct order for return values from transaction (thanks postblue) diff -r bd5008a7dcbd -r 14fe60a65c69 plugins/mod_storage_sql.lua --- a/plugins/mod_storage_sql.lua Mon Jan 23 19:32:07 2017 +0100 +++ b/plugins/mod_storage_sql.lua Tue Jan 24 19:26:40 2017 +0100 @@ -287,7 +287,7 @@ 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 @@ 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 = {