# HG changeset patch # User Kim Alvefur # Date 1373641389 -7200 # Node ID 3c57c2281087ae8d64f79dc1b5039ad7f904ba46 # Parent c7a664e496b37f23aea1b2fa5cc3255cfb52a665 util.sql: Don't fetch row count of result sets for queries that don't have result sets diff -r c7a664e496b3 -r 3c57c2281087 util/sql.lua --- a/util/sql.lua Fri Jul 12 02:53:24 2013 +0200 +++ b/util/sql.lua Fri Jul 12 17:03:09 2013 +0200 @@ -178,7 +178,6 @@ local result_mt = { __index = { affected = function(self) return self.__affected; end; - rowcount = function(self) return self.__rowcount; end; } }; function engine:execute_query(sql, ...) @@ -200,7 +199,7 @@ prepared[sql] = stmt; end assert(stmt:execute(...)); - return setmetatable({ __affected = stmt:affected(), __rowcount = stmt:rowcount() }, result_mt); + return setmetatable({ __affected = stmt:affected() }, result_mt); end engine.insert = engine.execute_update; engine.select = engine.execute_query;