aboutsummaryrefslogtreecommitdiffstats
path: root/util/sql.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-09-28 18:24:28 +0200
committerKim Alvefur <zash@zash.se>2019-09-28 18:24:28 +0200
commit272944f4dfb578ad6ed13c5d323cad4c74f3e5d1 (patch)
treec4e5b7b3dc500c5d72b97a50883d90af47514c48 /util/sql.lua
parent067ae06b1a476c0f35edcea59a1ab258dc655f88 (diff)
downloadprosody-272944f4dfb578ad6ed13c5d323cad4c74f3e5d1.tar.gz
prosody-272944f4dfb578ad6ed13c5d323cad4c74f3e5d1.zip
util.sql: Preserve 3rd and 4th return values from transaction (fixes #1434) (thanks mrdoctorwho)
Diffstat (limited to 'util/sql.lua')
-rw-r--r--util/sql.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/sql.lua b/util/sql.lua
index 4406d7ff..86740b1c 100644
--- a/util/sql.lua
+++ b/util/sql.lua
@@ -218,14 +218,14 @@ function engine:_transaction(func, ...)
end
end
function engine:transaction(...)
- local ok, ret = self:_transaction(...);
+ local ok, ret, b, c = self:_transaction(...);
if not ok then
local conn = self.conn;
if not conn or not conn:ping() then
log("debug", "Database connection was closed. Will reconnect and retry.");
self.conn = nil;
log("debug", "Retrying SQL transaction [%s]", (...));
- ok, ret = self:_transaction(...);
+ ok, ret, b, c = self:_transaction(...);
log("debug", "SQL transaction retry %s", ok and "succeeded" or "failed");
else
log("debug", "SQL connection is up, so not retrying");
@@ -234,7 +234,7 @@ function engine:transaction(...)
log("error", "Error in SQL transaction: %s", ret);
end
end
- return ok, ret;
+ return ok, ret, b, c;
end
function engine:_create_index(index)
local sql = "CREATE INDEX \""..index.name.."\" ON \""..index.table.."\" (";