Skip to content

Commit

Permalink
CREATE_OPTIONS is nullable in MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Dec 27, 2018
1 parent dac7d60 commit b8c5bee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,11 @@ public function listTableDetails($tableName)
/**
* @return string[]|true[]
*/
private function parseCreateOptions(string $string) : array
private function parseCreateOptions(?string $string) : array
{
$options = [];

if ($string === '') {
if ($string === null || $string === '') {
return $options;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -531,4 +531,11 @@ public function testEnsureTableWithoutOptionsAreReflectedInMetadata() : void
self::assertEquals('', $onlineTable->getOption('comment'));
self::assertEquals([], $onlineTable->getOption('create_options'));
}

public function testParseNullCreateOptions() : void
{
$table = $this->schemaManager->listTableDetails('sys.processlist');

self::assertEquals([], $table->getOption('create_options'));
}
}

0 comments on commit b8c5bee

Please sign in to comment.