Comparison

plugins/mod_storage_sql2.lua @ 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
parent 6282:bce801e40484
child 6534:b89406fa076c
child 6724:a8dbfa14e1a8
child 6736:4aee55c0cc5c
comparison
equal deleted inserted replaced
6531:18f4973849b1 6532:a966efeb6cb3
111 assert(params.driver and params.database, "Both the SQL driver and the database need to be specified"); 111 assert(params.driver and params.database, "Both the SQL driver and the database need to be specified");
112 112
113 --local dburi = db2uri(params); 113 --local dburi = db2uri(params);
114 engine = mod_sql:create_engine(params); 114 engine = mod_sql:create_engine(params);
115 115
116 engine:set_encoding();
117
118 if module:get_option("sql_manage_tables", true) then 116 if module:get_option("sql_manage_tables", true) then
119 -- Automatically create table, ignore failure (table probably already exists) 117 -- Automatically create table, ignore failure (table probably already exists)
120 create_table(); 118 create_table();
121 -- Encoding mess 119 -- Encoding mess
122 upgrade_table(); 120 upgrade_table();