Skip to content

Commit 322f075

Browse files
committed
ACP2E-3449: Slow query is executed when product widget is included via pagebuilder
1 parent 01de199 commit 322f075

File tree

1 file changed

+6
-7
lines changed
  • dev/tests/integration/testsuite/Magento/Rule/Model/Condition/Sql

1 file changed

+6
-7
lines changed

dev/tests/integration/testsuite/Magento/Rule/Model/Condition/Sql/BuilderTest.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function testAttachConditionToCollection(
118118
];
119119

120120
$rule->loadPost($ruleConditionArray);
121-
foreach($rule->getConditions()->getConditions() as $condition) {
121+
foreach ($rule->getConditions()->getConditions() as $condition) {
122122
if ($condition->getAttribute() === 'multi_select_attr') {
123123
$productCollection = $this->createMock(Collection::class);
124124
$limitationFilters = $this->createMock(ProductLimitation::class);
@@ -205,12 +205,11 @@ public static function attachConditionToCollectionDataProvider(): array
205205
'collected_attributes' => ['multiselect_attribute' => true],
206206
]
207207
],
208-
"WHERE ((((`e`.`entity_id` IN (SELECT `catalog_category_product`.`product_id` FROM " .
209-
"`catalog_category_product` WHERE (category_id IN ('3')))) AND(`e`.`sku` IN ('sku1', 'sku2', 'sku3'))" .
210-
" AND(`at_multi_select_attr`.`value` IN ('13', '14') OR " .
211-
"(FIND_IN_SET ('13', `at_multi_select_attr`.`value`) > 0) OR " .
212-
"(FIND_IN_SET ('14', `at_multi_select_attr`.`value`) > 0)) ))) AND " .
213-
"(e.created_in <= 1) AND (e.updated_in > 1)",
208+
"WHERE (((`e`.`entity_id` IN (SELECT `catalog_category_product`.`product_id` FROM " .
209+
"`catalog_category_product` WHERE (category_id IN ('3')))) " .
210+
"AND(`e`.`sku` IN ('sku1', 'sku2', 'sku3')) AND(`at_multi_select_attr`.`value` IN ('4', '5') OR " .
211+
"(FIND_IN_SET ('4', `at_multi_select_attr`.`value`) > 0) OR " .
212+
"(FIND_IN_SET ('5', `at_multi_select_attr`.`value`) > 0)) ))",
214213
"ORDER BY (FIELD(`e`.`sku`, 'sku1', 'sku2', 'sku3'))"
215214
]
216215
];

0 commit comments

Comments
 (0)