From 3793891566512de43725e9a6c3421daf51953ef5 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 13 Apr 2022 12:46:29 +0200 Subject: [inc/Database] Force more sql_mode options in debug mode --- inc/database.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/database.inc.php b/inc/database.inc.php index 48d8e3c6..654b6e92 100644 --- a/inc/database.inc.php +++ b/inc/database.inc.php @@ -37,7 +37,8 @@ class Database Util::traceError('Connecting to the local database failed: ' . $e->getMessage()); } if (CONFIG_DEBUG) { - Database::exec("SET sql_mode='STRICT_TRANS_TABLES'"); + Database::exec("SET SESSION sql_mode='STRICT_ALL_TABLES,NO_ENGINE_SUBSTITUTION,ERROR_FOR_DIVISION_BY_ZERO'"); + Database::exec("SET SESSION innodb_strict_mode=ON"); register_shutdown_function(function() { self::examineLoggedQueries(); }); -- cgit v1.2.3-55-g7522