Skip to content

Commit

Permalink
Set STRICT_TRANS_TABLES so that we can detect invalid values being in…
Browse files Browse the repository at this point in the history
…serted in the database
  • Loading branch information
campbell-m committed Oct 4, 2024
1 parent 005fe5f commit 52afe01
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions web/lib/MRBS/DB_mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ public function __construct(
// errors of the type "Syntax error or access violation: 1055 'mrbs.E.start_time' isn't in GROUP BY".
// TODO: However the proper solution is probably to rewrite the offending queries.
$this->command("SET sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''))");
// Set STRICT_TRANS_TABLES so that we can detect invalid values being inserted in the database
$this->command("SET SESSION sql_mode = 'STRICT_TRANS_TABLES'");
}
catch (PDOException $e)
{
Expand Down

0 comments on commit 52afe01

Please sign in to comment.