aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2015-06-03 15:54:52 +0100
committerMatthew Wild <mwild1@gmail.com>2015-06-03 15:54:52 +0100
commit15e84d4ec5ec7c13ebf09507ed4fb356e6925c6c (patch)
tree85525a90ea60f44210c19d95c4346a27ee15578f
parent424d93cdaccb441193cc04427eb8ff8b5533e2fd (diff)
downloadprosody-15e84d4ec5ec7c13ebf09507ed4fb356e6925c6c.tar.gz
prosody-15e84d4ec5ec7c13ebf09507ed4fb356e6925c6c.zip
util.sql: Rename some variable to match conventions
-rw-r--r--util/sql.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/util/sql.lua b/util/sql.lua
index 816c5d24..8d40a3e2 100644
--- a/util/sql.lua
+++ b/util/sql.lua
@@ -163,8 +163,8 @@ engine.delete = engine.execute_update;
engine.update = engine.execute_update;
function engine:_transaction(func, ...)
if not self.conn then
- local a,b = self:connect();
- if not a then return a,b; end
+ local ok, err = self:connect();
+ if not ok then return ok, err; end
end
--assert(not self.__transaction, "Recursive transactions not allowed");
local args, n_args = {...}, select("#", ...);
@@ -184,15 +184,15 @@ function engine:_transaction(func, ...)
end
end
function engine:transaction(...)
- local a,b = self:_transaction(...);
- if not a then
+ local ok, ret = self:_transaction(...);
+ if not ok then
local conn = self.conn;
if not conn or not conn:ping() then
self.conn = nil;
- a,b = self:_transaction(...);
+ ok, ret = self:_transaction(...);
end
end
- return a,b;
+ return ok, ret;
end
function engine:_create_index(index)
local sql = "CREATE INDEX `"..index.name.."` ON `"..index.table.."` (";