Comparison

util/sql.lua @ 6762:ea43a5af31ca

util.sql: Return failure if set_encoding() fails
author Matthew Wild <mwild1@gmail.com>
date Wed, 08 Jul 2015 15:10:25 +0100
parent 6760:e45a58c72609
child 6763:e961ac4efbb3
comparison
equal deleted inserted replaced
6761:b20efae224c9 6762:ea43a5af31ca
108 ); 108 );
109 if not dbh then return nil, err; end 109 if not dbh then return nil, err; end
110 dbh:autocommit(false); -- don't commit automatically 110 dbh:autocommit(false); -- don't commit automatically
111 self.conn = dbh; 111 self.conn = dbh;
112 self.prepared = {}; 112 self.prepared = {};
113 self:set_encoding(); 113 local ok, err = self:set_encoding();
114 if not ok then
115 return ok, err;
116 end
114 local ok, err = self:onconnect(); 117 local ok, err = self:onconnect();
115 if ok == false then 118 if ok == false then
116 return ok, err; 119 return ok, err;
117 end 120 end
118 return true; 121 return true;