# HG changeset patch # User Kim Alvefur # Date 1418285919 -3600 # Node ID a966efeb6cb3656178c36c0e47f169426b33d9eb # Parent 18f4973849b11116433b2ada37777f1aa8ff9271 mod_storage_sql2, util.sql: Set character encoding on every connect diff -r 18f4973849b1 -r a966efeb6cb3 plugins/mod_storage_sql2.lua --- a/plugins/mod_storage_sql2.lua Tue Dec 09 19:36:34 2014 +0100 +++ b/plugins/mod_storage_sql2.lua Thu Dec 11 09:18:39 2014 +0100 @@ -113,8 +113,6 @@ --local dburi = db2uri(params); engine = mod_sql:create_engine(params); - engine:set_encoding(); - if module:get_option("sql_manage_tables", true) then -- Automatically create table, ignore failure (table probably already exists) create_table(); diff -r 18f4973849b1 -r a966efeb6cb3 util/sql.lua --- a/util/sql.lua Tue Dec 09 19:36:34 2014 +0100 +++ b/util/sql.lua Thu Dec 11 09:18:39 2014 +0100 @@ -156,6 +156,7 @@ dbh:autocommit(false); -- don't commit automatically self.conn = dbh; self.prepared = {}; + self:set_encoding(); return true; end function engine:execute(sql, ...)