MDVA-15546: Column ‘entity_id’ where clause is ambiguous
The MDVA-15546 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 Quality Patches Tool (QPT) 1.0.20 is installed. The patch ID is MDVA-15546.
Affected products and versions
The patch is created for Adobe Commerce version:
Adobe Commerce on cloud infrastructure 2.2.5
Compatible with Adobe Commerce versions:
Adobe Commerce on cloud infrastructure 2.3.0 - 2.4.2
magento/quality-patches
package to the latest version and check the compatibility on the Quality Patches Tool: Search for patches page. Use the patch ID as a search keyword to locate the patch.Issue
Performance issues that may be related to some Amazon extensions.
Prerequisites:
Clean Adobe Commerce with B2B and Amazon_Payment.
Steps to reproduce:
- Go to the storefront 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 Jobflush_preview_quotashas 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_idAS
extension_attribute_amazon_order_reference_id_amazon_order_reference_id,
extension_attribute_amazon_order_reference_id.
quote_idAS
extension_attribute_amazon_order_reference_id_quote_id,
extension_attribute_amazon_order_reference_id.
sandbox_simulation_referenceAS
extension_attribute_amazon_order_reference_id_sandbox_simulation_reference,
extension_attribute_amazon_order_reference_id.
confirmedAS
extension_attribute_amazon_order_reference_id_confirmedFROM
quoteAS
main_tableLEFT JOIN
amazon_quoteAS
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
To apply individual patches, use the following links depending on your deployment method:
- Adobe Commerce or Magento Open Source on-premises: Software Update Guide > Apply Patches in our developer documentation.
- Adobe Commerce on cloud infrastructure: Upgrades and Patches > Apply Patches in our developer documentation.
Related reading
To learn more about Quality Patches Tool, refer to:
- Quality Patches Tool released: a new tool to self-serve quality patches in our support knowledge base.
- Check if patch is available for your Adobe Commerce issue using Quality Patches Tool in our support knowledge base.
For info about other patches available in QPT, refer to Patches available in QPT in our developer documentation.