diff --git a/lib/Magento/Framework/DB/Adapter/Pdo/Mysql.php b/lib/Magento/Framework/DB/Adapter/Pdo/Mysql.php index de85b40366bd7..eb9901041eac8 100644 --- a/lib/Magento/Framework/DB/Adapter/Pdo/Mysql.php +++ b/lib/Magento/Framework/DB/Adapter/Pdo/Mysql.php @@ -1100,7 +1100,8 @@ public function getCreateTable($tableName, $schemaName = null) $cacheKey = $this->_getTableName($tableName, $schemaName); $ddl = $this->loadDdlCache($cacheKey, self::DDL_CREATE); if ($ddl === false) { - $sql = 'SHOW CREATE TABLE ' . $this->quoteIdentifier($tableName); + $schemaName = empty($schemaName) === true ? '' : $this->quoteIdentifier($schemaName) . '.'; + $sql = 'SHOW CREATE TABLE ' . $schemaName . $this->quoteIdentifier($tableName); $ddl = $this->rawFetchRow($sql, 'Create Table'); $this->saveDdlCache($cacheKey, self::DDL_CREATE, $ddl); }