diff --git a/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php b/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php index 2c058b8bf6a..7bcd5533efc 100644 --- a/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php @@ -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; } diff --git a/tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php b/tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php index 937d04c9058..90ade2e86b8 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php @@ -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')); + } }