Skip to content

Commit fa50943

Browse files
authored
Merge branch 'magento-commerce:2.4-develop' into ACP2E-620-v2
2 parents 6c6756b + 608507e commit fa50943

File tree

1 file changed

+8
-0
lines changed
  • lib/internal/Magento/Framework/DB/Adapter/Pdo

1 file changed

+8
-0
lines changed

lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3561,6 +3561,14 @@ public function insertFromSelect(Select $select, $table, array $fields = [], $mo
35613561
$query .= ' IGNORE';
35623562
}
35633563
$query = sprintf('%s INTO %s', $query, $this->quoteIdentifier($table));
3564+
$countFieldsInSelect = count($select->getPart(Select::COLUMNS));
3565+
if (empty($fields) && $countFieldsInSelect > 1) {
3566+
$fields = array_slice(
3567+
array_keys($this->describeTable($table)),
3568+
0,
3569+
$countFieldsInSelect
3570+
);
3571+
}
35643572
if ($fields) {
35653573
$columns = array_map([$this, 'quoteIdentifier'], $fields);
35663574
$query = sprintf('%s (%s)', $query, join(', ', $columns));

0 commit comments

Comments
 (0)