Changeset

6532:a966efeb6cb3

mod_storage_sql2, util.sql: Set character encoding on every connect
author Kim Alvefur <zash@zash.se>
date Thu, 11 Dec 2014 09:18:39 +0100
parents 6531:18f4973849b1
children 6533:5da544e97bea
files plugins/mod_storage_sql2.lua util/sql.lua
diffstat 2 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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();
--- 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, ...)