Skip to content

Commit 1ddde99

Browse files
author
Stanislav Idolov
committed
MAGETWO-66195: SQL Error during price reindexation process for custom profile
1 parent 3ed9a1c commit 1ddde99

File tree

3 files changed

+3
-49
lines changed
  • app/code/Magento

3 files changed

+3
-49
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Eav/Source.php

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
*/
1616
class Source extends AbstractEav
1717
{
18-
const TRANSIT_PREFIX = 'transit_';
19-
2018
/**
2119
* Catalog resource helper
2220
*
@@ -363,45 +361,4 @@ private function saveDataFromSelect(\Magento\Framework\DB\Select $select, array
363361

364362
$this->_saveIndexData($data);
365363
}
366-
367-
/**
368-
* @inheritdoc
369-
*/
370-
protected function _prepareRelationIndex($parentIds = null)
371-
{
372-
$connection = $this->getConnection();
373-
$idxTable = $this->getIdxTable();
374-
375-
if (!$this->tableStrategy->getUseIdxTable()) {
376-
$additionalIdxTable = $connection->getTableName(self::TRANSIT_PREFIX . $this->getIdxTable());
377-
$connection->createTemporaryTableLike($additionalIdxTable, $idxTable);
378-
379-
$query = $connection->insertFromSelect(
380-
$this->_prepareRelationIndexSelect($parentIds),
381-
$additionalIdxTable,
382-
[]
383-
);
384-
$connection->query($query);
385-
386-
$select = $connection->select()->from($additionalIdxTable);
387-
$query = $connection->insertFromSelect(
388-
$select,
389-
$idxTable,
390-
[],
391-
\Magento\Framework\DB\Adapter\AdapterInterface::INSERT_IGNORE
392-
);
393-
$connection->query($query);
394-
395-
$connection->dropTemporaryTable($additionalIdxTable);
396-
} else {
397-
$query = $connection->insertFromSelect(
398-
$this->_prepareRelationIndexSelect($parentIds),
399-
$idxTable,
400-
[],
401-
\Magento\Framework\DB\Adapter\AdapterInterface::INSERT_IGNORE
402-
);
403-
$connection->query($query);
404-
}
405-
return $this;
406-
}
407364
}

app/code/Magento/Catalog/etc/di.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -958,10 +958,4 @@
958958
<argument name="connectionName" xsi:type="string">indexer</argument>
959959
</arguments>
960960
</type>
961-
<type name="Magento\Catalog\Model\ResourceModel\Product\Indexer\Eav\Source">
962-
<arguments>
963-
<argument name="tableStrategy" xsi:type="object">Magento\Catalog\Model\ResourceModel\Product\Indexer\TemporaryTableStrategy</argument>
964-
<argument name="connectionName" xsi:type="string">indexer</argument>
965-
</arguments>
966-
</type>
967961
</config>

app/code/Magento/GroupedProduct/Model/ResourceModel/Product/Indexer/Price/Grouped.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
class Grouped extends DefaultPrice implements GroupedInterface
1414
{
15+
/**
16+
* Prefix for temporary table support.
17+
*/
1518
const TRANSIT_PREFIX = 'transit_';
1619

1720
/**

0 commit comments

Comments
 (0)