Software /
code /
prosody
Diff
util/sql.lua @ 5742:3c57c2281087
util.sql: Don't fetch row count of result sets for queries that don't have result sets
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 12 Jul 2013 17:03:09 +0200 |
parent | 5739:2e9ad9cb206f |
child | 5743:8363dda76155 |
line wrap: on
line diff
--- 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;