aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/mod_storage_sql2.lua2
-rw-r--r--util/sql.lua1
2 files changed, 1 insertions, 2 deletions
diff --git a/plugins/mod_storage_sql2.lua b/plugins/mod_storage_sql2.lua
index 0531c905..d5e0494f 100644
--- a/plugins/mod_storage_sql2.lua
+++ b/plugins/mod_storage_sql2.lua
@@ -113,8 +113,6 @@ do -- process options to get a db connection
--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 --git a/util/sql.lua b/util/sql.lua
index 5a1dda5d..453597da 100644
--- a/util/sql.lua
+++ b/util/sql.lua
@@ -156,6 +156,7 @@ function engine:connect()
dbh:autocommit(false); -- don't commit automatically
self.conn = dbh;
self.prepared = {};
+ self:set_encoding();
return true;
end
function engine:execute(sql, ...)