Index: vendor/magento/framework/DB/Adapter/Pdo/Mysql.php IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php b/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php --- a/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php +++ b/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php (date 1661519230948) @@ -2229,10 +2229,14 @@ */ public function createTemporaryTableLike($temporaryTableName, $originTableName, $ifNotExists = false) { - $ifNotExistsSql = ($ifNotExists ? 'IF NOT EXISTS' : ''); + $ifNotExistsSql = ($ifNotExists ? ' IF NOT EXISTS' : ''); $temporaryTable = $this->quoteIdentifier($this->_getTableName($temporaryTableName)); $originTable = $this->quoteIdentifier($this->_getTableName($originTableName)); - $sql = sprintf('CREATE TEMPORARY TABLE %s %s LIKE %s', $ifNotExistsSql, $temporaryTable, $originTable); + $originCreate = $this->fetchPairs("SHOW CREATE TABLE {$originTable}"); + $sql = reset($originCreate); + $sql = preg_replace('/\/\*!50100 TABLESPACE [^\s]+ \*\//', '', $sql); + $sql = str_replace('CREATE TABLE', 'CREATE TEMPORARY TABLE' . $ifNotExistsSql, $sql); + $sql = str_replace($originTable, $temporaryTable, $sql); return $this->query($sql); }