aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2013-07-12 17:41:54 +0200
committerKim Alvefur <zash@zash.se>2013-07-12 17:41:54 +0200
commit051779d694221adc06600418becbdeda0f48d63e (patch)
treebb7bac60aef4104bdef44dc7d2e278b59137979b
parentc41f00e53fd2adcda02df292b98d01cebabfa773 (diff)
downloadprosody-051779d694221adc06600418becbdeda0f48d63e.tar.gz
prosody-051779d694221adc06600418becbdeda0f48d63e.zip
Backed out changeset 3c57c2281087
-rw-r--r--util/sql.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/sql.lua b/util/sql.lua
index 475215bb..771df7aa 100644
--- a/util/sql.lua
+++ b/util/sql.lua
@@ -178,6 +178,7 @@ end
local result_mt = { __index = {
affected = function(self) return self.__affected; end;
+ rowcount = function(self) return self.__rowcount; end;
} };
function engine:execute_query(sql, ...)
@@ -199,7 +200,7 @@ function engine:execute_update(sql, ...)
prepared[sql] = stmt;
end
assert(stmt:execute(...));
- return setmetatable({ __affected = stmt:affected() }, result_mt);
+ return setmetatable({ __affected = stmt:affected(), __rowcount = stmt:rowcount() }, result_mt);
end
engine.insert = engine.execute_update;
engine.select = engine.execute_query;