aboutsummaryrefslogtreecommitdiffstats
path: root/util/sql.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2015-07-08 15:10:25 +0100
committerMatthew Wild <mwild1@gmail.com>2015-07-08 15:10:25 +0100
commit9f5bd334c59da59813016d3f98cb31a5c144fcda (patch)
tree91dd0f69aa5f2c6588e75dd85867795d30dfc5aa /util/sql.lua
parent0fc9766334f6fdc84b02e256492931f16a76b80d (diff)
downloadprosody-9f5bd334c59da59813016d3f98cb31a5c144fcda.tar.gz
prosody-9f5bd334c59da59813016d3f98cb31a5c144fcda.zip
util.sql: Return failure if set_encoding() fails
Diffstat (limited to 'util/sql.lua')
-rw-r--r--util/sql.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/util/sql.lua b/util/sql.lua
index fc1191f9..d0da9302 100644
--- a/util/sql.lua
+++ b/util/sql.lua
@@ -110,7 +110,10 @@ function engine:connect()
dbh:autocommit(false); -- don't commit automatically
self.conn = dbh;
self.prepared = {};
- self:set_encoding();
+ local ok, err = self:set_encoding();
+ if not ok then
+ return ok, err;
+ end
local ok, err = self:onconnect();
if ok == false then
return ok, err;