diff --git a/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php b/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php index 96179590bec..ef24c3f98f9 100644 --- a/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php @@ -361,6 +361,21 @@ public function getListTablesSQL() return "SHOW FULL TABLES WHERE Table_type = 'BASE TABLE'"; } + /** + * @param string + * @param string|null $database + * @return string + */ + public function getTableOptionsSQL($table, $database = null) + { + $database = $database ? "'". $database . "'" : 'DATABASE()'; + + return "SELECT ENGINE as engine, TABLE_COLLATION as collation, ". + "CREATE_OPTIONS as create_options, TABLE_COMMENT as comment ". + "FROM information_schema.TABLES WHERE TABLE_SCHEMA = " . $database . " AND TABLE_NAME = '". + $table . "' AND TABLE_TYPE='BASE TABLE'"; + } + /** * {@inheritDoc} */ diff --git a/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php b/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php index 4478ca92ead..e4345a1df6c 100644 --- a/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php @@ -285,7 +285,10 @@ public function listTableDetails($tableName) } $indexes = $this->listTableIndexes($tableName); - return new Table($tableName, $columns, $indexes, $foreignKeys, false, array()); + $sql = $this->_platform->getTableOptionsSQL($tableName); + $options = $this->_conn->fetchAssoc($sql); + + return new Table($tableName, $columns, $indexes, $foreignKeys, false, $options); } /**