Skip to content

Commit 2192f02

Browse files
committed
ACP2E-3449: Slow query is executed when product widget is included via pagebuilder
1 parent 0862ae2 commit 2192f02

File tree

1 file changed

+8
-9
lines changed
  • dev/tests/integration/testsuite/Magento/Rule/Model/Condition/Sql

1 file changed

+8
-9
lines changed

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,10 @@ public static function attachConditionToCollectionDataProvider(): array
179179
'value' => 'sku1,sku2,sku3,sku4,sku5',
180180
]
181181
],
182-
"WHERE ((((`e`.`entity_id` IN (SELECT `catalog_category_product`.`product_id` FROM " .
182+
"(((`e`.`entity_id` IN (SELECT `catalog_category_product`.`product_id` FROM " .
183183
"`catalog_category_product` WHERE (category_id IN ('3')))) " .
184-
"AND(`e`.`entity_id` = '2017-09-15 00:00:00') AND(`e`.`sku` IN " .
185-
"('sku1', 'sku2', 'sku3', 'sku4', 'sku5')) ))) AND (e.created_in <= 1) AND (e.updated_in > 1)",
184+
"AND(`e`.`entity_id` = '2017-09-15 00:00:00') " .
185+
"AND(`e`.`sku` IN ('sku1', 'sku2', 'sku3', 'sku4', 'sku5'))",
186186
"ORDER BY (FIELD(`e`.`sku`, 'sku1', 'sku2', 'sku3', 'sku4', 'sku5'))"
187187
],
188188
[
@@ -212,12 +212,11 @@ public static function attachConditionToCollectionDataProvider(): array
212212
'collected_attributes' => ['multiselect_attribute' => true],
213213
]
214214
],
215-
"WHERE ((((`e`.`entity_id` IN (SELECT `catalog_category_product`.`product_id` FROM " .
216-
"`catalog_category_product` WHERE (category_id IN ('3')))) AND(`e`.`sku` IN " .
217-
"('sku1', 'sku2', 'sku3')) AND(`at_multi_select_attr`.`value` IN ('#optionAtrId1#', '#optionAtrId2#') OR " .
218-
"(FIND_IN_SET ('#optionAtrId1#', `at_multi_select_attr`.`value`) > 0) OR " .
219-
"(FIND_IN_SET ('#optionAtrId2#', `at_multi_select_attr`.`value`) > 0)) ))) AND " .
220-
"(e.created_in <= 1) AND (e.updated_in > 1)",
215+
"(((`e`.`entity_id` IN (SELECT `catalog_category_product`.`product_id` FROM " .
216+
"`catalog_category_product` WHERE (category_id IN ('3')))) " .
217+
"AND(`e`.`sku` IN ('sku1', 'sku2', 'sku3')) AND(`at_multi_select_attr`.`value` IN ('4', '5') OR " .
218+
"(FIND_IN_SET ('4', `at_multi_select_attr`.`value`) > 0) OR " .
219+
"(FIND_IN_SET ('5', `at_multi_select_attr`.`value`) > 0))",
221220
"ORDER BY (FIELD(`e`.`sku`, 'sku1', 'sku2', 'sku3'))"
222221
]
223222
];

0 commit comments

Comments
 (0)