diff --git a/library/Icingadb/Common/Backend.php b/library/Icingadb/Common/Backend.php index 15cb93cc..26d52f0c 100644 --- a/library/Icingadb/Common/Backend.php +++ b/library/Icingadb/Common/Backend.php @@ -15,6 +15,7 @@ use ipl\Sql\Expression; use ipl\Sql\QueryBuilder; use ipl\Sql\Select; use PDO; +use Pdo\Mysql; /** * Singleton providing access to the Icinga DB and Redis @@ -61,7 +62,8 @@ final class Backend $config->options = [PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ]; if ($config->db === 'mysql') { - $config->options[PDO::MYSQL_ATTR_INIT_COMMAND] = "SET SESSION SQL_MODE='STRICT_TRANS_TABLES" + $config->options[Mysql::ATTR_INIT_COMMAND] + = "SET SESSION SQL_MODE='STRICT_TRANS_TABLES" . ",NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'"; }