Skip to content

[Issue] Fixed table difference insert during price reindex #36482

@m2-assistant

Description

@m2-assistant

This issue is automatically created based on existing pull request: #36370: Fixed table difference insert during price reindex


Description (*)

Problem appears when dimensions are not used.
catalog_product_index_price is now incompatible with catalog_product_index_price_tmp as new ID columnt added
https://devdocs.magento.com/guides/v2.4/release-notes/backward-incompatible-changes/reference.html
so method works incorrectly as final query contains additional column

\Magento\Catalog\Model\Indexer\Product\Price\AbstractAction::_syncData

We faced this issue while running graphql tests when indexers is set - update on save
The issue might be skipped in fixtures but when tests are placing the order - it triggers reindex that blocks order placing.

In query logs we may see how temp table is created

## 140 ## QUERY
SQL: CREATE TEMPORARY TABLE IF NOT EXISTS `catalog_product_index_price_temp` LIKE `catalog_product_index_price_tmp`
AFF: 0
TIME: 0.0008

Related Pull Requests

Fixed Issues (if relevant)

cannot reindex price

Magento\Framework\Exception\LocalizedException: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1, query was: INSERT INTO `catalog_product_index_price` SELECT `ip_tmp`.* FROM `catalog_product_index_price_temp` AS `ip_tmp` ON DUPLICATE KEY UPDATE `tax_class_id` = VALUES(`tax_class_id`), `price` = VALUES(`price`), `final_price` = VALUES(`final_price`), `min_price` = VALUES(`min_price`), `max_price` = VALUES(`max_price`), `tier_price` = VALUES(`tier_price`) in /home/www/magento/vendor/magento/module-catalog/Model/Indexer/Product/Price/Action/Row.php on line 32
  1. Fixes magento/magento2#<issue_number>

Manual testing scenarios (*)

  1. Set indexer update on save
  2. Create product on 2.4.5 installation
  3. Create custom script to reindex
  4. RUN Magento\Catalog\Model\Indexer\Product\Price::executeRow
  5. See error.
  6. Apply patch from this PR
  7. retry reindex - no error

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md files for modified modules are updated and included in the pull request if any README.md predefined sections require an update
  • All automated tests passed successfully (all builds are green)

Metadata

Metadata

Assignees

Labels

Priority: P1Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing.Progress: done

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions