From 9f5bd334c59da59813016d3f98cb31a5c144fcda Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 8 Jul 2015 15:10:25 +0100 Subject: util.sql: Return failure if set_encoding() fails --- util/sql.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'util/sql.lua') 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; -- cgit v1.2.3