mirror of
https://github.com/bjc/prosody.git
synced 2025-04-05 14:17:37 +03:00
util.sql: Don't fetch row count of result sets for queries that don't have result sets
This commit is contained in:
parent
3d9b1be698
commit
c41f00e53f
1 changed files with 1 additions and 2 deletions
|
@ -178,7 +178,6 @@ end
|
|||
|
||||
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 @@ function engine:execute_update(sql, ...)
|
|||
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue