Apply charset and collation only if they are specified
This commit is contained in:
@ -32,8 +32,16 @@ class Database {
|
||||
$driver_options = array(
|
||||
'TIME_ZONE = "' . Env::$db_timezone_offset . '"',
|
||||
'sql_mode=(SELECT REPLACE(@@sql_mode,"ONLY_FULL_GROUP_BY",""))',
|
||||
'NAMES ' . Env::$db_charset . ' COLLATE ' . ENV::$db_collation,
|
||||
);
|
||||
|
||||
if(!empty(Env::$db_charset)) {
|
||||
$character_set = 'NAMES ' . Env::$db_charset;
|
||||
if(!empty(Env::$db_collation)) {
|
||||
$character_set .= ' COLLATE ' . Env::$db_collation;
|
||||
}
|
||||
$driver_options[] = $character_set;
|
||||
}
|
||||
|
||||
$current_options = ORM::for_table("")
|
||||
->raw_query('SELECT @@session.wait_timeout as wait_timeout')
|
||||
->findOne();
|
||||
|
Reference in New Issue
Block a user