Skip to content

Commit

Permalink
Handle the case that the innodb_large_prefix variable no longer exist…
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Mar 1, 2018
1 parent 95ea4a6 commit e5b39f7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Doctrine/Schema/DcaSchemaProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,11 +463,12 @@ private function getDefaultIndexLength(Table $table): int
->fetch(\PDO::FETCH_OBJ)
;

if (\in_array(strtolower((string) $largePrefix->Value), ['1', 'on'], true)) {
// The variable no longer exists (as of MySQL 8 and MariaDB 10.3)
if (false === $largePrefix) {
return 3072;
}

return 767;
return \in_array(strtolower((string) $largePrefix->Value), ['1', 'on'], true) ? 3072 : 767;
}

/**
Expand Down

0 comments on commit e5b39f7

Please sign in to comment.