Skip to content

Commit

Permalink
Fix: #2561 - upper/lower case used by different versions of MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Roach committed Aug 29, 2019
1 parent 7bf2ba3 commit 1a6f767
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/Services/ServerCheckService.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ private function databaseEngineWarnings(): Collection

if ($connection->getDriverName() === 'mysql') {
$rows = DB::select(
"SELECT table_name, engine FROM information_schema.tables JOIN information_schema.engines USING (engine) WHERE table_schema = ? AND LEFT(table_name, ?) = ? AND transactions <> 'YES'",[
"SELECT table_name FROM information_schema.tables JOIN information_schema.engines USING (engine) WHERE table_schema = ? AND LEFT(table_name, ?) = ? AND transactions <> 'YES'",[
$connection->getDatabaseName(),
mb_strlen($connection->getTablePrefix()),
$connection->getTablePrefix(),
Expand All @@ -363,7 +363,8 @@ private function databaseEngineWarnings(): Collection
$rows = new Collection($rows);

$rows = $rows->map(static function (stdClass $row): string {
return '<code>ALTER TABLE ' . $row->TABLE_NAME . ' ENGINE=InnoDB;</code>';
$table = $row->TABLE_NAME ?? $row->table_name;
return '<code>ALTER TABLE `' . $table . '` ENGINE=InnoDB;</code>';
});

if ($rows->isNotEmpty()) {
Expand Down

0 comments on commit 1a6f767

Please sign in to comment.