summaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authorSimon Rettberg2022-04-13 12:46:29 +0200
committerSimon Rettberg2022-04-13 12:46:29 +0200
commit3793891566512de43725e9a6c3421daf51953ef5 (patch)
tree1fd8874b7dd1446181cc3664257c3a0456e4cc1d /inc
parent[statistics] ID44/ID45 naming (diff)
downloadslx-admin-3793891566512de43725e9a6c3421daf51953ef5.tar.gz
slx-admin-3793891566512de43725e9a6c3421daf51953ef5.tar.xz
slx-admin-3793891566512de43725e9a6c3421daf51953ef5.zip
[inc/Database] Force more sql_mode options in debug mode
Diffstat (limited to 'inc')
-rw-r--r--inc/database.inc.php3
1 files changed, 2 insertions, 1 deletions
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();
});