- Sets MySQL timeout to 60 seconds
This commit is contained in:
@@ -55,7 +55,8 @@ class Initializer {
|
||||
\ORM::configure('logging', WP_DEBUG);
|
||||
\ORM::configure('driver_options', array(
|
||||
\PDO::MYSQL_ATTR_INIT_COMMAND =>
|
||||
'SET TIME_ZONE = "' . Env::$db_timezone_offset . '", ' .
|
||||
'SET SESSION wait_timeout = 60, ' .
|
||||
'TIME_ZONE = "' . Env::$db_timezone_offset . '", ' .
|
||||
'sql_mode=(SELECT REPLACE(@@sql_mode,"ONLY_FULL_GROUP_BY",""))'
|
||||
));
|
||||
|
||||
|
@@ -8,13 +8,16 @@ class InitializerTest extends MailPoetTest {
|
||||
->raw_query(
|
||||
'SELECT ' .
|
||||
'@@sql_mode as sql_mode, ' .
|
||||
'@@session.time_zone as time_zone'
|
||||
'@@session.time_zone as time_zone, ' .
|
||||
'@@session.wait_timeout as wait_timeout'
|
||||
)
|
||||
->findOne();
|
||||
// disable ONLY_FULL_GROUP_BY
|
||||
expect($result->sql_mode)->notContains('ONLY_FULL_GROUP_BY');
|
||||
// time zone should be set based on WP's time zone
|
||||
expect($result->time_zone)->equals(Env::$db_timezone_offset);
|
||||
// connection timeout should be set to 60 seconds
|
||||
expect($result->wait_timeout)->equals(60);
|
||||
}
|
||||
|
||||
function testItConfiguresHooks() {
|
||||
|
Reference in New Issue
Block a user