The MDVA-15546 Magento patch solves performance issues that may be related to some Amazon extensions. This issue in indicated by the following error in exception logs: where Column 'entity_id' in where clause is ambiguous, query was: SELECT `main_table`.*, `extension_attribute_amazon_order_reference_id`. This patch is available when the Magento Quality Patch (MQP) tool 1.0.20 is installed. The patch ID is MDVA-15546.
Affected products and versions
The patch is created for Magento version:
Magento Commerce Cloud 2.2.5
Compatible with Magento versions:
Magento Commerce Cloud 2.3.0 - 2.4.2
Note: the patch might become applicable to other versions with new MQP tool releases. To check if the patch is compatible with your Magento version, run ./vendor/bin/magento-patches status
.
Issue
Performance issues that may be related to some Amazon extensions.
Prerequisites: Clean Magento with B2B and Amazon_Payment.
Steps to reproduce:
- Go to the store front page.
- Add product to the cart.
- Wait or trigger the cron job
flush_preview_quotas
.
Actual result:
When you check var/log/exception/log
you see following error:
report.ERROR: Cron Job flush_preview_quotas
has an error: SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'entity_id' in where clause is ambiguous, query was: SELECT `main_table`.*, `extension_attribute_amazon_order_reference_id`.`amazon_order_reference_id` AS `extension_attribute_amazon_order_reference_id_amazon_order_reference_id`, `extension_attribute_amazon_order_reference_id`.`quote_id` AS `extension_attribute_amazon_order_reference_id_quote_id`, `extension_attribute_amazon_order_reference_id`.` sandbox_simulation_reference` AS `extension_attribute_amazon_order_reference_id_sandbox_simulation_reference`, `extension_attribute_amazon_order_reference_id`.`confirmed` AS `extension_attribute_amazon_order_reference_id_confirmed` FROM `quote` AS `main_table` LEFT JOIN `amazon_quote` AS `extension_attribute_amazon_order_reference_id` ON main_table.entity_id = extension_attribute_amazon_order_reference_id.quote_id WHERE ...
Expected result:
Cron Job completes without errors.
Apply the patch
For instructions on how to apply an MQP patch, use the following links depending on your Magento product:
- Magento Commerce: DevDocs Apply patches using Magento Quality Patches Tool.
- Magento Commerce Cloud: DevDocs Upgrades and Patches > Apply patches.
Related reading
To learn more about Magento Quality Patches, refer to:
- Magento Quality Patches released: a new tool to self-serve quality patches.
- Check if patch is available for your Magento issue using Magento Quality Patches.
For info about other patches available in MQP tool, refer to the Patches available in MQP tool section.