# HG changeset patch # User Kim Alvefur # Date 1432052483 -7200 # Node ID a8dbfa14e1a88885f46c69d26f0f53d1c302418c # Parent 936cf2f7531ff4ce099667208e6e50f102aa20d8 mod_storage_sql2: Include 'with' field from iterator like some 3rd party archive-capable storage modules diff -r 936cf2f7531f -r a8dbfa14e1a8 plugins/mod_storage_sql2.lua --- a/plugins/mod_storage_sql2.lua Tue May 19 15:33:20 2015 +0200 +++ b/plugins/mod_storage_sql2.lua Tue May 19 18:21:23 2015 +0200 @@ -281,7 +281,7 @@ local user,store = username,self.store; local total; local ok, result = engine:transaction(function() - local sql_query = "SELECT `key`, `type`, `value`, `when` FROM `prosodyarchive` WHERE %s ORDER BY `sort_id` %s%s;"; + local sql_query = "SELECT `key`, `type`, `value`, `when`, `with` FROM `prosodyarchive` WHERE %s ORDER BY `sort_id` %s%s;"; local args = { host, user or "", store, }; local where = { "`host` = ?", "`user` = ?", "`store` = ?", }; @@ -313,7 +313,7 @@ return function() local row = result(); if row ~= nil then - return row[1], deserialize(row[2], row[3]), row[4]; + return row[1], deserialize(row[2], row[3]), row[4], row[5]; end end, total; end