diff options
author | Matthew Wild <mwild1@gmail.com> | 2015-07-08 15:10:25 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2015-07-08 15:10:25 +0100 |
commit | 9f5bd334c59da59813016d3f98cb31a5c144fcda (patch) | |
tree | 91dd0f69aa5f2c6588e75dd85867795d30dfc5aa /util | |
parent | 0fc9766334f6fdc84b02e256492931f16a76b80d (diff) | |
download | prosody-9f5bd334c59da59813016d3f98cb31a5c144fcda.tar.gz prosody-9f5bd334c59da59813016d3f98cb31a5c144fcda.zip |
util.sql: Return failure if set_encoding() fails
Diffstat (limited to 'util')
-rw-r--r-- | util/sql.lua | 5 |
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; |