Skip to content

Commit

Permalink
Actually check for ON/OFF
Browse files Browse the repository at this point in the history
  • Loading branch information
nickygerritsen committed Nov 24, 2024
1 parent 6b7f214 commit 087b2b8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ services:
ports:
# Useful to connect a local MySQL client / GUI
- 127.0.0.1:13306:3306
command: --max-connections=1000 --max-allowed-packet=512M
command: --max-connections=1000 --max-allowed-packet=512M --innodb_snapshot_isolation=OFF
volumes:
- /var/lib/mysql
domjudge:
Expand Down
6 changes: 3 additions & 3 deletions webapp/src/Controller/Jury/JuryMiscController.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ public function __construct(
public function indexAction(ConfigurationService $config): Response
{
if ($this->isGranted('ROLE_ADMIN')) {
$innodbSnapshotIsolation = $this->em->getConnection()->query('SHOW VARIABLES LIKE "innodb_snapshot_isolation"')->fetchOne();
if ($innodbSnapshotIsolation) {
$this->addFlash('danger', 'InnoDB snapshot isolation is enabled. Set --innodb_snapshot_isolation=false in your MariaDB configuration. See https://github.com/DOMjudge/domjudge/issues/2848 for more information.');
$innodbSnapshotIsolation = $this->em->getConnection()->query('SHOW VARIABLES LIKE "innodb_snapshot_isolation"')->fetchAssociative();
if ($innodbSnapshotIsolation && $innodbSnapshotIsolation['Value'] === 'ON') {
$this->addFlash('danger', 'InnoDB snapshot isolation is enabled. Set --innodb_snapshot_isolation=OFF in your MariaDB configuration. See https://github.com/DOMjudge/domjudge/issues/2848 for more information.');
}
}

Expand Down
4 changes: 2 additions & 2 deletions webapp/src/Service/CheckConfigService.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ public function checkMysqlSettings(): ConfigCheckItem
$desc .= sprintf("max_allowed_packet is set to %s.\n", Utils::printsize((int)$vars['max_allowed_packet']));
}

if ($vars['innodb_snapshot_isolation'] === 'true') {
if ($vars['innodb_snapshot_isolation'] === 'ON') {
$result = 'E';
$desc .= 'InnoDB snapshot isolation is enabled. Set --innodb_snapshot_isolation=false in your MariaDB configuration. See https://github.com/DOMjudge/domjudge/issues/2848 for more information.';
$desc .= 'InnoDB snapshot isolation is enabled. Set --innodb_snapshot_isolation=OFF in your MariaDB configuration. See https://github.com/DOMjudge/domjudge/issues/2848 for more information.';
} else {
$desc .= "InnoDB snapshot isolation is not enabled.\n";
}
Expand Down

0 comments on commit 087b2b8

Please sign in to comment.