From 4ac223bb23fce658e1e14b01e3f75bfb44b1e0fb Mon Sep 17 00:00:00 2001 From: "vishalverma.magento279" Date: Wed, 23 Oct 2019 19:02:42 +0530 Subject: [PATCH 001/439] #25192 fixed --- app/code/Magento/Dhl/Model/Carrier.php | 1 + app/code/Magento/Dhl/etc/config.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Dhl/Model/Carrier.php b/app/code/Magento/Dhl/Model/Carrier.php index 5959294fe6dc7..ee2ef84db1f8e 100644 --- a/app/code/Magento/Dhl/Model/Carrier.php +++ b/app/code/Magento/Dhl/Model/Carrier.php @@ -675,6 +675,7 @@ public function getDhlProducts($doc) 'H' => __('Economy select'), 'J' => __('Jumbo box'), 'M' => __('Express 10:30'), + 'N' => __('Domestic express'), 'V' => __('Europack'), 'Y' => __('Express 12:00'), ]; diff --git a/app/code/Magento/Dhl/etc/config.xml b/app/code/Magento/Dhl/etc/config.xml index b46152fb0ecad..ea47e4de90f05 100644 --- a/app/code/Magento/Dhl/etc/config.xml +++ b/app/code/Magento/Dhl/etc/config.xml @@ -21,7 +21,7 @@ 0 DHL 0 - 1,3,4,8,P,Q,E,F,H,J,M,V,Y + 1,3,4,8,P,Q,E,F,H,J,M,N,V,Y 2,5,6,7,9,B,C,D,U,K,L,G,W,I,N,O,R,S,T,X G https://xmlpi-ea.dhl.com/XMLShippingServlet From a220df1e08597bd04e97f531e654d11937725796 Mon Sep 17 00:00:00 2001 From: "vishalverma.magento279" Date: Wed, 23 Oct 2019 19:38:49 +0530 Subject: [PATCH 002/439] testcase update --- app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php index d1b35c8e2b77f..e9400e65bc405 100644 --- a/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php +++ b/app/code/Magento/Dhl/Test/Unit/Model/CarrierTest.php @@ -332,6 +332,7 @@ public function dhlProductsDataProvider(): array 'H' => 'Economy select', 'J' => 'Jumbo box', 'M' => 'Express 10:30', + 'N' => 'Domestic express', 'V' => 'Europack', 'Y' => 'Express 12:00', ], From cfab7825e1d5ce33d38bc81963ee60d3dd04f41a Mon Sep 17 00:00:00 2001 From: korostii <24894168+korostii@users.noreply.github.com> Date: Tue, 17 Dec 2019 14:29:37 +0000 Subject: [PATCH 003/439] Fix #26080 --- app/code/Magento/MessageQueue/etc/di.xml | 1 - app/etc/di.xml | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/MessageQueue/etc/di.xml b/app/code/Magento/MessageQueue/etc/di.xml index f60eb5fbc20df..b283280dc4580 100644 --- a/app/code/Magento/MessageQueue/etc/di.xml +++ b/app/code/Magento/MessageQueue/etc/di.xml @@ -6,7 +6,6 @@ */ --> - diff --git a/app/etc/di.xml b/app/etc/di.xml index dfbf4f2373ac5..3a094477e35be 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -187,6 +187,7 @@ + From 405dfec0026e6be2c11281d31774f08a293ded2d Mon Sep 17 00:00:00 2001 From: Stanislav Ilnytskyi Date: Fri, 14 Feb 2020 14:00:50 +0100 Subject: [PATCH 004/439] Product not exist fix when attempt to get an image --- app/code/Magento/Catalog/Helper/Image.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Helper/Image.php b/app/code/Magento/Catalog/Helper/Image.php index 5b0aa0c496ecd..085fb2c224b14 100644 --- a/app/code/Magento/Catalog/Helper/Image.php +++ b/app/code/Magento/Catalog/Helper/Image.php @@ -514,7 +514,7 @@ protected function initBaseFile() if ($this->getImageFile()) { $model->setBaseFile($this->getImageFile()); } else { - $model->setBaseFile($this->getProduct()->getData($model->getDestinationSubdir())); + $model->setBaseFile($this->getProduct() ? $this->getProduct()->getData($model->getDestinationSubdir()) : ''); } } return $this; From f70f1d23c76939e9b1cce5231d178a963d7ae622 Mon Sep 17 00:00:00 2001 From: Andrii Kasian Date: Mon, 2 Mar 2020 22:25:05 -0600 Subject: [PATCH 005/439] Explicitly define type for in condition --- .../Model/ResourceModel/Index.php | 4 +-- .../ResourceModel/Selection/Collection.php | 4 +-- .../Model/Resolver/Links/Collection.php | 2 +- .../Indexer/Category/Flat/AbstractAction.php | 9 ++++-- .../Indexer/Category/Flat/Action/Rows.php | 3 +- .../Category/Product/AbstractAction.php | 9 +++--- .../Indexer/Product/Category/Action/Rows.php | 10 +++---- .../Indexer/Product/Flat/FlatTableBuilder.php | 8 ++++-- .../Indexer/Product/Flat/TableBuilder.php | 12 ++++++-- .../Indexer/Product/Price/AbstractAction.php | 4 +-- .../Product/Attribute/AttributeSetFinder.php | 2 +- .../Model/Product/Price/PricePersistence.php | 2 +- .../Product/Price/TierPricePersistence.php | 2 +- .../Model/ResourceModel/AbstractResource.php | 14 ++++++++-- .../Catalog/Model/ResourceModel/Category.php | 7 +++-- .../Model/ResourceModel/Category/Flat.php | 5 ++-- .../Collection/AbstractCollection.php | 12 +++++--- .../Catalog/Model/ResourceModel/Product.php | 8 ++++-- .../ResourceModel/Product/Collection.php | 9 +++--- .../Model/ResourceModel/Product/Gallery.php | 3 +- .../Product/Indexer/Price/DefaultPrice.php | 2 +- .../Product/Indexer/Price/TierPrice.php | 2 +- .../Product/Link/Product/Collection.php | 8 +++--- .../Model/ResourceModel/Product/Website.php | 3 +- .../Model/Indexer/ProductPriceIndexFilter.php | 2 +- .../Model/Indexer/Stock/CacheCleaner.php | 2 +- .../Model/ResourceModel/Stock.php | 6 ++-- .../Model/ResourceModel/Stock/Status.php | 2 +- .../Indexer/ProductPriceIndexModifier.php | 2 +- .../Model/ConfigurableProductsProvider.php | 2 +- .../Indexer/Fulltext/Action/DataProvider.php | 7 +++-- .../Model/Indexer/Fulltext/Action/Full.php | 2 +- .../Model/ResourceModel/Fulltext.php | 3 +- .../Model/ResourceModel/Search/Collection.php | 6 ++-- .../Product/Indexer/Price/Configurable.php | 2 +- .../Product/Type/Configurable.php | 3 +- .../Configurable/Attribute/Collection.php | 3 +- .../Type/Configurable/Product/Collection.php | 2 +- .../Entity/Collection/AbstractCollection.php | 6 ++-- .../Model/ResourceModel/Entity/Attribute.php | 3 +- .../Entity/Attribute/Collection.php | 6 ++-- .../Eav/Model/ResourceModel/ReadHandler.php | 2 +- lib/internal/Magento/Framework/DB/Select.php | 2 +- test.php | 28 +++++++++++++++++++ 44 files changed, 154 insertions(+), 81 deletions(-) create mode 100644 test.php diff --git a/app/code/Magento/AdvancedSearch/Model/ResourceModel/Index.php b/app/code/Magento/AdvancedSearch/Model/ResourceModel/Index.php index b20872da2f8e7..be2e68cf30e1e 100644 --- a/app/code/Magento/AdvancedSearch/Model/ResourceModel/Index.php +++ b/app/code/Magento/AdvancedSearch/Model/ResourceModel/Index.php @@ -108,7 +108,7 @@ protected function _getCatalogProductPriceData($productIds = null) ['entity_id', 'customer_group_id', 'website_id', 'min_price'] ); if ($productIds) { - $select->where('entity_id IN (?)', $productIds); + $select->where('entity_id IN (?)', $productIds, \Zend_Db::BIGINT_TYPE); } $catalogProductIndexPriceSelect[] = $select; } @@ -177,7 +177,7 @@ public function getCategoryProductIndexData($storeId = null, $productIds = null) ); if ($productIds) { - $select->where('product_id IN (?)', $productIds); + $select->where('product_id IN (?)', $productIds, \Zend_Db::BIGINT_TYPE); } $result = []; diff --git a/app/code/Magento/Bundle/Model/ResourceModel/Selection/Collection.php b/app/code/Magento/Bundle/Model/ResourceModel/Selection/Collection.php index 7b3f6dd8bbefa..11c83622a3b54 100644 --- a/app/code/Magento/Bundle/Model/ResourceModel/Selection/Collection.php +++ b/app/code/Magento/Bundle/Model/ResourceModel/Selection/Collection.php @@ -215,7 +215,7 @@ public function joinPrices($websiteId) public function setOptionIdsFilter($optionIds) { if (!empty($optionIds)) { - $this->getSelect()->where('selection.option_id IN (?)', $optionIds); + $this->getSelect()->where('selection.option_id IN (?)', $optionIds, \Zend_Db::BIGINT_TYPE); } return $this; } @@ -229,7 +229,7 @@ public function setOptionIdsFilter($optionIds) public function setSelectionIdsFilter($selectionIds) { if (!empty($selectionIds)) { - $this->getSelect()->where('selection.selection_id IN (?)', $selectionIds); + $this->getSelect()->where('selection.selection_id IN (?)', $selectionIds, \Zend_Db::BIGINT_TYPE); } return $this; } diff --git a/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php b/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php index 13bf10bc6aca7..76e670721c31d 100644 --- a/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php +++ b/app/code/Magento/BundleGraphQl/Model/Resolver/Links/Collection.php @@ -108,7 +108,7 @@ private function fetch() : array } $linkCollection->getSelect() - ->where($field . ' IN (?)', $this->parentIds); + ->where($field . ' IN (?)', $this->parentIds, \Zend_Db::BIGINT_TYPE); /** @var Selection $link */ foreach ($linkCollection as $link) { diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Flat/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Category/Flat/AbstractAction.php index 1506ccf6963bf..50e8df10d57ff 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Flat/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Flat/AbstractAction.php @@ -414,7 +414,8 @@ private function getLinkIds(array $entityIds) [$linkField] )->where( 'e.entity_id IN (?)', - $entityIds + $entityIds, + \Zend_Db::BIGINT_TYPE ); return $this->connection->fetchCol($select); @@ -459,10 +460,12 @@ protected function getAttributeTypeValues($type, $entityIds, $storeId) ] )->where( "e.entity_id IN (?)", - $entityIds + $entityIds, + \Zend_Db::BIGINT_TYPE )->where( 'def.store_id IN (?)', - [\Magento\Store\Model\Store::DEFAULT_STORE_ID, $storeId] + [\Magento\Store\Model\Store::DEFAULT_STORE_ID, $storeId], + \Zend_Db::BIGINT_TYPE ); return $this->connection->fetchAll($select); diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Flat/Action/Rows.php b/app/code/Magento/Catalog/Model/Indexer/Category/Flat/Action/Rows.php index c722206193eb3..00499232c8c33 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Flat/Action/Rows.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Flat/Action/Rows.php @@ -119,7 +119,8 @@ protected function filterIdsByStore(array $ids, $store) "path = {$rootIdExpr} OR path = {$rootCatIdExpr} OR path like {$catIdExpr}" )->where( "entity_id IN (?)", - $ids + $ids, + \Zend_Db::BIGINT_TYPE ); $resultIds = []; diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php index 178f4172ce6fa..b0aeea3230d70 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php @@ -502,10 +502,11 @@ protected function createAnchorSelect(Store $store) [] )->joinInner( ['cc2' => $temporaryTreeTable], - 'cc2.parent_id = cc.entity_id AND cc.entity_id NOT IN (' . implode( - ',', - $rootCatIds - ) . ')', + $this->connection->quoteInto( + 'cc2.parent_id = cc.entity_id AND cc.entity_id NOT IN ()', + $rootCatIds, + \Zend_Db::BIGINT_TYPE + ), [] )->joinInner( ['ccp' => $this->getTable('catalog_category_product')], diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php b/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php index ec3d0d57330ec..3a9c4a94e58e5 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Category/Action/Rows.php @@ -151,7 +151,7 @@ private function getProductIdsWithParents(array $childProductIds): array ->select() ->from(['relation' => $this->getTable('catalog_product_relation')], []) ->distinct(true) - ->where('child_id IN (?)', $childProductIds) + ->where('child_id IN (?)', $childProductIds, \Zend_Db::BIGINT_TYPE) ->join( ['cpe' => $this->getTable('catalog_product_entity')], 'relation.parent_id = cpe.' . $fieldForParent, @@ -215,7 +215,7 @@ protected function removeEntries() protected function getNonAnchorCategoriesSelect(\Magento\Store\Model\Store $store) { $select = parent::getNonAnchorCategoriesSelect($store); - return $select->where('ccp.product_id IN (?)', $this->limitationByProducts); + return $select->where('ccp.product_id IN (?)', $this->limitationByProducts, \Zend_Db::BIGINT_TYPE); } /** @@ -227,7 +227,7 @@ protected function getNonAnchorCategoriesSelect(\Magento\Store\Model\Store $stor protected function getAnchorCategoriesSelect(\Magento\Store\Model\Store $store) { $select = parent::getAnchorCategoriesSelect($store); - return $select->where('ccp.product_id IN (?)', $this->limitationByProducts); + return $select->where('ccp.product_id IN (?)', $this->limitationByProducts, \Zend_Db::BIGINT_TYPE); } /** @@ -239,7 +239,7 @@ protected function getAnchorCategoriesSelect(\Magento\Store\Model\Store $store) protected function getAllProducts(\Magento\Store\Model\Store $store) { $select = parent::getAllProducts($store); - return $select->where('cp.entity_id IN (?)', $this->limitationByProducts); + return $select->where('cp.entity_id IN (?)', $this->limitationByProducts, \Zend_Db::BIGINT_TYPE); } /** @@ -265,7 +265,7 @@ private function getCategoryIdsFromIndex(array $productIds): array $storeCategories = $this->connection->fetchCol( $this->connection->select() ->from($this->getIndexTable($store->getId()), ['category_id']) - ->where('product_id IN (?)', $productIds) + ->where('product_id IN (?)', $productIds, \Zend_Db::BIGINT_TYPE) ->distinct() ); $categoryIds[] = $storeCategories; diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/FlatTableBuilder.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/FlatTableBuilder.php index 2252b3e3d5506..0d62f780c9aa2 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/FlatTableBuilder.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/FlatTableBuilder.php @@ -340,7 +340,9 @@ protected function _updateTemporaryTableByStoreValues( [$attributeCode => 't.value'] ); if (!empty($changedIds)) { - $select->where($this->_connection->quoteInto('et.entity_id IN (?)', $changedIds)); + $select->where( + $this->_connection->quoteInto('et.entity_id IN (?)', $changedIds, \Zend_Db::BIGINT_TYPE) + ); } $sql = $select->crossUpdateFromSelect(['et' => $temporaryFlatTableName]); $this->_connection->query($sql); @@ -363,7 +365,9 @@ protected function _updateTemporaryTableByStoreValues( [$columnName => $columnValue] )->where($columnValue . ' IS NOT NULL'); if (!empty($changedIds)) { - $select->where($this->_connection->quoteInto('et.entity_id IN (?)', $changedIds)); + $select->where( + $this->_connection->quoteInto('et.entity_id IN (?)', $changedIds, \Zend_Db::BIGINT_TYPE)) + ; } $sql = $select->crossUpdateFromSelect(['et' => $temporaryFlatTableName]); $this->_connection->query($sql); diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableBuilder.php b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableBuilder.php index c0722901e3b1c..c0632c6c246ce 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableBuilder.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Flat/TableBuilder.php @@ -233,7 +233,9 @@ protected function _fillTemporaryEntityTable($tableName, array $columns, array $ $select->from(['e' => $tableName], $columns); $onDuplicate = false; if (!empty($changedIds)) { - $select->where($this->_connection->quoteInto('e.entity_id IN (?)', $changedIds)); + $select->where( + $this->_connection->quoteInto('e.entity_id IN (?)', $changedIds, \Zend_Db::BIGINT_TYPE) + ); $onDuplicate = true; } $sql = $select->insertFromSelect($temporaryEntityTable, $columns, $onDuplicate); @@ -347,7 +349,9 @@ protected function _fillTemporaryTable( } if (!empty($changedIds)) { - $select->where($this->_connection->quoteInto('e.entity_id IN (?)', $changedIds)); + $select->where( + $this->_connection->quoteInto('e.entity_id IN (?)', $changedIds, \Zend_Db::BIGINT_TYPE) + ); } $sql = $select->insertFromSelect($temporaryTableName, $columns, true); @@ -355,7 +359,9 @@ protected function _fillTemporaryTable( if (count($valueColumns) > 1) { if (!empty($changedIds)) { - $selectValue->where($this->_connection->quoteInto('e.entity_id IN (?)', $changedIds)); + $selectValue->where( + $this->_connection->quoteInto('e.entity_id IN (?)', $changedIds, \Zend_Db::BIGINT_TYPE) + ); } $sql = $selectValue->insertFromSelect($temporaryValueTableName, $valueColumns, true); $this->_connection->query($sql); diff --git a/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php index e9a907f0b5097..1b4d61c899428 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Product/Price/AbstractAction.php @@ -410,7 +410,7 @@ private function deleteIndexData(array $entityIds) $select = $this->getConnection()->select()->from( ['index_price' => $this->tableMaintainer->getMainTable($dimensions)], null - )->where('index_price.entity_id IN (?)', $entityIds); + )->where('index_price.entity_id IN (?)', $entityIds, \Zend_Db::BIGINT_TYPE); $query = $select->deleteFromSelect('index_price'); $this->getConnection()->query($query); } @@ -519,7 +519,7 @@ private function getProductsTypes(array $changedIds = []) ['entity_id', 'type_id'] ); if ($changedIds) { - $select->where('entity_id IN (?)', $changedIds); + $select->where('entity_id IN (?)', $changedIds, \Zend_Db::BIGINT_TYPE); } $pairs = $this->getConnection()->fetchPairs($select); diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/AttributeSetFinder.php b/app/code/Magento/Catalog/Model/Product/Attribute/AttributeSetFinder.php index 4df67d1c01f16..5211f7470afc2 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/AttributeSetFinder.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/AttributeSetFinder.php @@ -37,7 +37,7 @@ public function findAttributeSetIdsByProductIds(array $productIds) ->getSelect() ->reset(Select::COLUMNS) ->columns(ProductInterface::ATTRIBUTE_SET_ID) - ->where('entity_id IN (?)', $productIds) + ->where('entity_id IN (?)', $productIds, \Zend_Db::BIGINT_TYPE) ->group(ProductInterface::ATTRIBUTE_SET_ID); $result = $collection->getConnection()->fetchCol($select); return $result; diff --git a/app/code/Magento/Catalog/Model/Product/Price/PricePersistence.php b/app/code/Magento/Catalog/Model/Product/Price/PricePersistence.php index e3085f7cdefe3..0b8baa56243b3 100644 --- a/app/code/Magento/Catalog/Model/Product/Price/PricePersistence.php +++ b/app/code/Magento/Catalog/Model/Product/Price/PricePersistence.php @@ -97,7 +97,7 @@ public function get(array $skus) ->select() ->from($this->attributeResource->getTable($this->table)); return $this->attributeResource->getConnection()->fetchAll( - $select->where($this->getEntityLinkField() . ' IN (?)', $ids) + $select->where($this->getEntityLinkField() . ' IN (?)', $ids, \Zend_Db::BIGINT_TYPE) ->where('attribute_id = ?', $this->getAttributeId()) ); } diff --git a/app/code/Magento/Catalog/Model/Product/Price/TierPricePersistence.php b/app/code/Magento/Catalog/Model/Product/Price/TierPricePersistence.php index fd247d2ce9e32..1088fa7417444 100644 --- a/app/code/Magento/Catalog/Model/Product/Price/TierPricePersistence.php +++ b/app/code/Magento/Catalog/Model/Product/Price/TierPricePersistence.php @@ -56,7 +56,7 @@ public function get(array $ids) { $select = $this->tierpriceResource->getConnection()->select()->from($this->tierpriceResource->getMainTable()); return $this->tierpriceResource->getConnection()->fetchAll( - $select->where($this->getEntityLinkField() . ' IN (?)', $ids) + $select->where($this->getEntityLinkField() . ' IN (?)', $ids, \Zend_Db::BIGINT_TYPE) ); } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/AbstractResource.php b/app/code/Magento/Catalog/Model/ResourceModel/AbstractResource.php index 3946be32184ec..cf0e82046f3a5 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/AbstractResource.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/AbstractResource.php @@ -147,7 +147,7 @@ protected function _getLoadAttributesSelect($object, $table) ->select() ->from(['attr_table' => $table], []) ->where("attr_table.{$this->getLinkField()} = ?", $object->getData($this->getLinkField())) - ->where('attr_table.store_id IN (?)', $storeIds); + ->where('attr_table.store_id IN (?)', $storeIds, \Zend_Db::BIGINT_TYPE); if ($setId) { $select->join( @@ -562,7 +562,11 @@ public function getAttributeRawValue($entityId, $attribute, $store) if ($typedAttributes) { foreach ($typedAttributes as $table => $_attributes) { $defaultJoinCondition = [ - $connection->quoteInto('default_value.attribute_id IN (?)', array_keys($_attributes)), + $connection->quoteInto( + 'default_value.attribute_id IN (?)', + array_keys($_attributes), + \Zend_Db::BIGINT_TYPE + ), "default_value.{$this->getLinkField()} = e.{$this->getLinkField()}", 'default_value.store_id = 0', ]; @@ -589,7 +593,11 @@ public function getAttributeRawValue($entityId, $attribute, $store) 'store_value.attribute_id' ); $joinCondition = [ - $connection->quoteInto('store_value.attribute_id IN (?)', array_keys($_attributes)), + $connection->quoteInto( + 'store_value.attribute_id IN (?)', + array_keys($_attributes), + \Zend_Db::BIGINT_TYPE + ), "store_value.{$this->getLinkField()} = e.{$this->getLinkField()}", 'store_value.store_id = :store_id', ]; diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Category.php b/app/code/Magento/Catalog/Model/ResourceModel/Category.php index c4980c917d069..86868a7b28ff6 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Category.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Category.php @@ -13,13 +13,13 @@ namespace Magento\Catalog\Model\ResourceModel; +use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Model\Indexer\Category\Product\Processor; +use Magento\Catalog\Setup\CategorySetup; use Magento\Framework\App\ObjectManager; use Magento\Framework\DataObject; use Magento\Framework\EntityManager\EntityManager; -use Magento\Catalog\Setup\CategorySetup; use Magento\Framework\EntityManager\MetadataPool; -use Magento\Catalog\Api\Data\ProductInterface; /** * Resource model for category entity @@ -666,7 +666,8 @@ public function findWhereAttributeIs($entityIdsFilter, $attribute, $expectedValu 'ci.value = :value' )->where( 'ce.entity_id IN (?)', - $entityIdsFilter + $entityIdsFilter, + \Zend_Db::BIGINT_TYPE ); $this->entitiesWhereAttributesIs[$entityIdsFilterHash][$attribute->getId()][$expectedValue] = $this->getConnection()->fetchCol($selectEntities, $bind); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Category/Flat.php b/app/code/Magento/Catalog/Model/ResourceModel/Category/Flat.php index 05950531e2178..ffe485a31018f 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Category/Flat.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Category/Flat.php @@ -294,7 +294,7 @@ protected function _loadNodes($parentNode = null, $recursionLevel = 0, $storeId $inactiveCategories = $this->getInactiveCategoryIds(); if (!empty($inactiveCategories)) { - $select->where('main_table.entity_id NOT IN (?)', $inactiveCategories); + $select->where('main_table.entity_id NOT IN (?)', $inactiveCategories, \Zend_Db::BIGINT_TYPE); } // Allow extensions to modify select (e.g. add custom category attributes to select) @@ -681,7 +681,8 @@ public function getAnchorsAbove(array $filterIds, $storeId = 0) 1 )->where( 'entity_id IN (?)', - $filterIds + $filterIds, + \Zend_Db::BIGINT_TYPE ); return $this->getConnection()->fetchCol($select); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Collection/AbstractCollection.php b/app/code/Magento/Catalog/Model/ResourceModel/Collection/AbstractCollection.php index 3a0d47fe573fb..490406d7f68f5 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Collection/AbstractCollection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Collection/AbstractCollection.php @@ -170,10 +170,12 @@ protected function _getLoadAttributesSelect($table, $attributeIds = []) ['e.entity_id'] )->where( "e.entity_id IN (?)", - array_keys($this->_itemsById) + array_keys($this->_itemsById), + \Zend_Db::BIGINT_TYPE )->where( 't_d.attribute_id IN (?)', - $attributeIds + $attributeIds, + \Zend_Db::BIGINT_TYPE )->joinLeft( ['t_s' => $table], implode(' AND ', $joinCondition), @@ -192,10 +194,12 @@ protected function _getLoadAttributesSelect($table, $attributeIds = []) ['e.entity_id'] )->where( "e.entity_id IN (?)", - array_keys($this->_itemsById) + array_keys($this->_itemsById), + \Zend_Db::BIGINT_TYPE )->where( 'attribute_id IN (?)', - $attributeIds + $attributeIds, + \Zend_Db::BIGINT_TYPE )->where( 'store_id = ?', $this->getDefaultStoreId() diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product.php b/app/code/Magento/Catalog/Model/ResourceModel/Product.php index c5587d3b25665..747893875d23b 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product.php @@ -232,7 +232,8 @@ public function getWebsiteIdsByProductIds($productIds) ['product_id', 'website_id'] )->where( 'product_id IN (?)', - $productIds + $productIds, + \Zend_Db::BIGINT_TYPE ); $productsWebsites = []; foreach ($this->getConnection()->fetchAll($select) as $productInfo) { @@ -357,7 +358,7 @@ private function deleteSelectedEntityAttributeRows(DataObject $product, array $a $entityId = $product->getData($entityIdField); foreach ($backendTables as $backendTable => $attributes) { $connection = $this->getConnection(); - $where = $connection->quoteInto('attribute_id IN (?)', $attributes); + $where = $connection->quoteInto('attribute_id IN (?)', $attributes, \Zend_Db::BIGINT_TYPE); $where .= $connection->quoteInto(" AND {$entityIdField} = ?", $entityId); $connection->delete($backendTable, $where); } @@ -594,7 +595,8 @@ public function getProductsSku(array $productIds) ['entity_id', 'sku'] )->where( 'entity_id IN (?)', - $productIds + $productIds, + \Zend_Db::BIGINT_TYPE ); return $this->getConnection()->fetchAll($select); } diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php index afbe279045a38..5f43adc3ab349 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php @@ -857,7 +857,8 @@ protected function doAddWebsiteNamesToResult() ['name'] )->where( 'product_website.product_id IN (?)', - array_keys($productWebsites) + array_keys($productWebsites), + \Zend_Db::BIGINT_TYPE )->where( 'website.website_id > ?', 0 @@ -1333,7 +1334,7 @@ public function addCountToCategories($categoryCollection) $anchorStmt = clone $select; $anchorStmt->limit(); //reset limits - $anchorStmt->where('count_table.category_id IN (?)', $isAnchor); + $anchorStmt->where('count_table.category_id IN (?)', $isAnchor, \Zend_Db::BIGINT_TYPE); $productCounts += $this->getConnection()->fetchPairs($anchorStmt); $anchorStmt = null; } @@ -1341,7 +1342,7 @@ public function addCountToCategories($categoryCollection) $notAnchorStmt = clone $select; $notAnchorStmt->limit(); //reset limits - $notAnchorStmt->where('count_table.category_id IN (?)', $isNotAnchor); + $notAnchorStmt->where('count_table.category_id IN (?)', $isNotAnchor, \Zend_Db::BIGINT_TYPE); $notAnchorStmt->where('count_table.is_parent = 1'); $productCounts += $this->getConnection()->fetchPairs($notAnchorStmt); $notAnchorStmt = null; @@ -2151,7 +2152,7 @@ public function addCategoryIds() $select = $this->getConnection()->select(); $select->from($this->_productCategoryTable, ['product_id', 'category_id']); - $select->where('product_id IN (?)', $ids); + $select->where('product_id IN (?)', $ids, \Zend_Db::BIGINT_TYPE); $data = $this->getConnection()->fetchAll($select); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Gallery.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Gallery.php index a9741cd8e1ec7..b3caeb80b2da7 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Gallery.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Gallery.php @@ -487,7 +487,8 @@ public function getProductImages($product, $storeIds) $product->getData($this->metadata->getLinkField()) )->where( 'store_id IN (?)', - $storeIds + $storeIds, + \Zend_Db::BIGINT_TYPE )->where( 'attribute_code IN (?)', ['small_image', 'thumbnail', 'image'] diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/DefaultPrice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/DefaultPrice.php index b64cca4ff1b26..fb77a3fad8939 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/DefaultPrice.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/DefaultPrice.php @@ -775,7 +775,7 @@ protected function _movePriceDataToIndexTable($entityIds = null) $select = $connection->select()->from($table, $columns); if ($entityIds !== null) { - $select->where('entity_id in (?)', count($entityIds) > 0 ? $entityIds : 0); + $select->where('entity_id in (?)', count($entityIds) > 0 ? $entityIds : 0, \Zend_Db::BIGINT_TYPE); } $query = $select->insertFromSelect($this->getIdxTable(), [], false); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/TierPrice.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/TierPrice.php index a866c1eaa413f..602c2c781443e 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/TierPrice.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/TierPrice.php @@ -193,7 +193,7 @@ private function getTierPriceSelect(bool $isAllWebsites, bool $isAllCustomerGrou [] ); if (!empty($entityIds)) { - $select->where('entity.entity_id IN (?)', $entityIds); + $select->where('entity.entity_id IN (?)', $entityIds, \Zend_Db::BIGINT_TYPE); } $this->joinWebsites($select, $isAllWebsites); $this->joinCustomerGroups($select, $isAllCustomerGroups); diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Link/Product/Collection.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Link/Product/Collection.php index f1d4552cf37f0..7d702eb76e555 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Link/Product/Collection.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Link/Product/Collection.php @@ -239,7 +239,7 @@ public function addExcludeProductFilter($products) $products = [$products]; } $this->_hasLinkFilter = true; - $this->getSelect()->where('links.linked_product_id NOT IN (?)', $products); + $this->getSelect()->where('links.linked_product_id NOT IN (?)', $products, \Zend_Db::BIGINT_TYPE); } return $this; } @@ -257,7 +257,7 @@ public function addProductFilter($products) $products = [$products]; } $identifierField = $this->getLinkField(); - $this->getSelect()->where("product_entity_table.$identifierField IN (?)", $products); + $this->getSelect()->where("product_entity_table.$identifierField IN (?)", $products, \Zend_Db::BIGINT_TYPE); $this->_hasLinkFilter = true; } @@ -319,10 +319,10 @@ protected function _joinLinks() $linkField = $this->getLinkField(); if ($this->productIds) { if ($this->_isStrongMode) { - $this->getSelect()->where('links.product_id in (?)', $this->productIds); + $this->getSelect()->where('links.product_id in (?)', $this->productIds, \Zend_Db::BIGINT_TYPE); } else { $joinType = 'joinLeft'; - $joinCondition[] = $connection->quoteInto('links.product_id in (?)', $this->productIds); + $joinCondition[] = $connection->quoteInto('links.product_id in (?)', $this->productIds, \Zend_Db::BIGINT_TYPE); } if (count($this->productIds) === 1) { $this->addFieldToFilter( diff --git a/app/code/Magento/Catalog/Model/ResourceModel/Product/Website.php b/app/code/Magento/Catalog/Model/ResourceModel/Product/Website.php index 771f781678e44..dc5efb83c86c7 100644 --- a/app/code/Magento/Catalog/Model/ResourceModel/Product/Website.php +++ b/app/code/Magento/Catalog/Model/ResourceModel/Product/Website.php @@ -125,7 +125,8 @@ public function getWebsites($productIds) ['product_id', 'website_id'] )->where( 'product_id IN (?)', - $productIds + $productIds, + \Zend_Db::BIGINT_TYPE ); $rowset = $this->getConnection()->fetchAll($select); diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php b/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php index 35231b8460b19..514cd2e3e88c5 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/ProductPriceIndexFilter.php @@ -105,7 +105,7 @@ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds = } if (!empty($entityIds)) { - $select->where('stock_item.product_id in (?)', $entityIds); + $select->where('stock_item.product_id in (?)', $entityIds, \Zend_Db::BIGINT_TYPE); } $select->group('stock_item.product_id'); diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/CacheCleaner.php b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/CacheCleaner.php index b3fa07479a712..e38ff58dfe1f6 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/Stock/CacheCleaner.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/Stock/CacheCleaner.php @@ -118,7 +118,7 @@ private function getProductStockStatuses(array $productIds) 'cpr.parent_id = cpe.' . $linkField, ['parent_id' => 'cpe.entity_id'] ) - ->where('product_id IN (?)', $productIds) + ->where('product_id IN (?)', $productIds, \Zend_Db::BIGINT_TYPE) ->where('stock_id = ?', Stock::DEFAULT_STOCK_ID) ->where('website_id = ?', $this->stockConfiguration->getDefaultScopeId()); diff --git a/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock.php b/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock.php index 53f00529b9bcc..bb8ff4ce65bba 100644 --- a/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock.php +++ b/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock.php @@ -127,12 +127,12 @@ public function lockProductsStock(array $productIds, $websiteId) $itemTable = $this->getTable('cataloginventory_stock_item'); $select = $this->getConnection()->select()->from(['si' => $itemTable]) ->where('website_id = ?', $websiteId) - ->where('product_id IN(?)', $productIds) + ->where('product_id IN(?)', $productIds, \Zend_Db::BIGINT_TYPE) ->forUpdate(true); $productTable = $this->getTable('catalog_product_entity'); $selectProducts = $this->getConnection()->select()->from(['p' => $productTable], []) - ->where('entity_id IN (?)', $productIds) + ->where('entity_id IN (?)', $productIds, \Zend_Db::BIGINT_TYPE) ->columns( [ 'product_id' => 'entity_id', @@ -147,7 +147,7 @@ public function lockProductsStock(array $productIds, $websiteId) foreach ($this->getConnection()->fetchAll($selectProducts) as $p) { $items[$p['product_id']]['type_id'] = $p['type_id']; } - + return $items; } diff --git a/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php b/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php index 402ce5f2f611e..6ffa6f4a1169b 100644 --- a/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php +++ b/app/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Status.php @@ -321,7 +321,7 @@ public function getProductStatus($productIds, $storeId = null) if ($storeId === null || $storeId == \Magento\Store\Model\Store::DEFAULT_STORE_ID) { $select = $connection->select()->from($attributeTable, [$linkField, 'value']) - ->where("{$linkField} IN (?)", $productIds) + ->where("{$linkField} IN (?)", $productIds, \Zend_Db::BIGINT_TYPE) ->where('attribute_id = ?', $attribute->getAttributeId()) ->where('store_id = ?', \Magento\Store\Model\Store::DEFAULT_STORE_ID); diff --git a/app/code/Magento/CatalogRule/Model/Indexer/ProductPriceIndexModifier.php b/app/code/Magento/CatalogRule/Model/Indexer/ProductPriceIndexModifier.php index 404fc32e0c0d4..7f64573587ca0 100644 --- a/app/code/Magento/CatalogRule/Model/Indexer/ProductPriceIndexModifier.php +++ b/app/code/Magento/CatalogRule/Model/Indexer/ProductPriceIndexModifier.php @@ -71,7 +71,7 @@ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds = [] ); if ($entityIds) { - $select->where('i.entity_id IN (?)', $entityIds); + $select->where('i.entity_id IN (?)', $entityIds, \Zend_Db::BIGINT_TYPE); } $finalPrice = $priceTable->getFinalPriceField(); diff --git a/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/ConfigurableProductsProvider.php b/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/ConfigurableProductsProvider.php index dd020114b03ab..d6e8033987ee8 100644 --- a/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/ConfigurableProductsProvider.php +++ b/app/code/Magento/CatalogRuleConfigurable/Plugin/CatalogRule/Model/ConfigurableProductsProvider.php @@ -40,7 +40,7 @@ public function getIds(array $ids) ->select() ->from(['e' => $this->resource->getTableName('catalog_product_entity')], ['e.entity_id']) ->where('e.type_id = ?', \Magento\ConfigurableProduct\Model\Product\Type\Configurable::TYPE_CODE) - ->where('e.entity_id IN (?)', $ids) + ->where('e.entity_id IN (?)', $ids, \Zend_Db::BIGINT_TYPE) ); } return $this->productIds[$key]; diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider.php index cd2529a8fd725..9ec48cfa05694 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/DataProvider.php @@ -242,7 +242,7 @@ private function getSelectForSearchableProducts( $this->joinAttribute($select, 'status', $storeId, [Status::STATUS_ENABLED]); if ($productIds !== null) { - $select->where('e.entity_id IN (?)', $productIds); + $select->where('e.entity_id IN (?)', $productIds, \Zend_Db::BIGINT_TYPE); } $select->where('e.entity_id > ?', $lastProductId); $select->order('e.entity_id'); @@ -323,7 +323,7 @@ public function getSearchableAttributes($backendType = null) 'catelogsearch_searchable_attributes_load_after', ['engine' => $this->engine, 'attributes' => $attributes] ); - + $this->eventManager->dispatch( 'catalogsearch_searchable_attributes_load_after', ['engine' => $this->engine, 'attributes' => $attributes] @@ -410,7 +410,8 @@ public function getProductAttributes($storeId, array $productIds, array $attribu [$linkField, 'entity_id'] )->where( 'cpe.entity_id IN (?)', - $productIds + $productIds, + \Zend_Db::BIGINT_TYPE ) ); foreach ($attributeTypes as $backendType => $attributeIds) { diff --git a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php index f56a4fe4d1b76..55b9649f26614 100644 --- a/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php +++ b/app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php @@ -324,7 +324,7 @@ protected function getProductIdsFromParents(array $entityIds) ->select() ->from(['relation' => $this->getTable('catalog_product_relation')], []) ->distinct(true) - ->where('child_id IN (?)', $entityIds) + ->where('child_id IN (?)', $entityIds, \Zend_Db::BIGINT_TYPE) ->join( ['cpe' => $this->getTable('catalog_product_entity')], 'relation.parent_id = cpe.' . $linkField, diff --git a/app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext.php b/app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext.php index 0835fb66f876a..da95e9cf3603b 100644 --- a/app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext.php +++ b/app/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext.php @@ -115,7 +115,8 @@ public function getRelationsByChild($childIds) ['cpe.entity_id'] )->where( 'relation.child_id IN (?)', - $childIds + $childIds, + \Zend_Db::BIGINT_TYPE ); return $connection->fetchCol($select); diff --git a/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php b/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php index e625ccbe51fe3..df4f834006e80 100644 --- a/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/ResourceModel/Search/Collection.php @@ -258,7 +258,8 @@ protected function _getSearchEntityIdsSql($query, $searchOnlyInCurrentStore = tr [] )->where( 't1.attribute_id IN (?)', - $attributeIds + $attributeIds, + \Zend_Db::BIGINT_TYPE )->where( 't1.store_id = ?', 0 @@ -332,7 +333,8 @@ protected function _getSearchInOptionSql($query) 'd.store_id=0' )->where( 'o.attribute_id IN (?)', - $attributeIds + $attributeIds, + \Zend_Db::BIGINT_TYPE )->where( $this->_resourceHelper->getCILike($ifValue, $this->_searchQuery, ['position' => 'any']) ); diff --git a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/Configurable.php index b7bbf7aa1871c..b60ea1d07b85a 100644 --- a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Indexer/Price/Configurable.php @@ -222,7 +222,7 @@ private function fillTemporaryOptionsTable(string $temporaryOptionsTableName, ar ['le.entity_id', 'customer_group_id', 'website_id'] ); if ($entityIds !== null) { - $select->where('le.entity_id IN (?)', $entityIds); + $select->where('le.entity_id IN (?)', $entityIds, \Zend_Db::BIGINT_TYPE); } $query = $select->insertFromSelect($temporaryOptionsTableName); $this->getConnection()->query($query); diff --git a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable.php b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable.php index feffd22a0fb3d..0abfd953e3435 100644 --- a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable.php +++ b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable.php @@ -173,7 +173,8 @@ public function getChildrenIds($parentId, $required = true) [] )->where( 'p.entity_id IN (?)', - $parentId + $parentId, + \Zend_Db::BIGINT_TYPE ); $childrenIds = [ diff --git a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute/Collection.php b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute/Collection.php index 57f701721a6f3..61ebdc5531b6a 100644 --- a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute/Collection.php +++ b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Attribute/Collection.php @@ -285,7 +285,8 @@ protected function _loadLabels() ['use_default' => $useDefaultCheck, 'label' => $labelCheck] )->where( 'def.product_super_attribute_id IN (?)', - array_keys($this->_items) + array_keys($this->_items), + \Zend_Db::BIGINT_TYPE )->where( 'def.store_id = ?', 0 diff --git a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Product/Collection.php b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Product/Collection.php index b76954075bcde..d25423dd6e9d2 100644 --- a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Product/Collection.php +++ b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Product/Collection.php @@ -84,7 +84,7 @@ protected function _renderFilters() $parentIds[] = $product->getData($metadata->getLinkField()); } - $this->getSelect()->where('link_table.parent_id in (?)', $parentIds); + $this->getSelect()->where('link_table.parent_id in (?)', $parentIds,\Zend_Db::BIGINT_TYPE); return $this; } diff --git a/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php b/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php index e50abbc11e54a..8cf21f6108d93 100644 --- a/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php +++ b/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php @@ -1238,10 +1238,12 @@ protected function _getLoadAttributesSelect($table, $attributeIds = []) ['t_d.attribute_id'] )->where( " e.entity_id IN (?)", - array_keys($this->_itemsById) + array_keys($this->_itemsById), + \Zend_Db::BIGINT_TYPE )->where( 't_d.attribute_id IN (?)', - $attributeIds + $attributeIds, + \Zend_Db::BIGINT_TYPE ); if ($entity->getEntityTable() == \Magento\Eav\Model\Entity::DEFAULT_ENTITY_TABLE && $entity->getTypeId()) { diff --git a/app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute.php b/app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute.php index 9e4ad6fb53a33..84e3092879f5c 100644 --- a/app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute.php +++ b/app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute.php @@ -769,7 +769,8 @@ public function getValidAttributeIds($attributeIds) ['attribute_id'] )->where( 'attribute_id IN (?)', - $attributeIds + $attributeIds, + \Zend_Db::BIGINT_TYPE ); return $connection->fetchCol($select); diff --git a/app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute/Collection.php b/app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute/Collection.php index 6fce6bd2dc44e..e54f888b0ffab 100644 --- a/app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute/Collection.php +++ b/app/code/Magento/Eav/Model/ResourceModel/Entity/Attribute/Collection.php @@ -221,7 +221,8 @@ public function setInAllAttributeSetsFilter(array $setIds) ) ->where( 'entity_attribute.attribute_set_id IN (?)', - $setIds + $setIds, + \Zend_Db::BIGINT_TYPE ) ->group('entity_attribute.attribute_id') ->having(new \Zend_Db_Expr('COUNT(*)') . ' = ' . count($setIds)); @@ -394,7 +395,8 @@ protected function _addSetInfo() ['group_sort_order' => 'sort_order'] )->where( 'attribute_id IN (?)', - $attributeIds + $attributeIds, + \Zend_Db::BIGINT_TYPE ); $result = $connection->fetchAll($select); diff --git a/app/code/Magento/Eav/Model/ResourceModel/ReadHandler.php b/app/code/Magento/Eav/Model/ResourceModel/ReadHandler.php index bf1405fa64122..54eb815fd10a6 100644 --- a/app/code/Magento/Eav/Model/ResourceModel/ReadHandler.php +++ b/app/code/Magento/Eav/Model/ResourceModel/ReadHandler.php @@ -152,7 +152,7 @@ public function execute($entityType, $entityData, $arguments = []) ['value' => 't.value', 'attribute_id' => 't.attribute_id'] ) ->where($metadata->getLinkField() . ' = ?', $entityData[$metadata->getLinkField()]) - ->where('attribute_id IN (?)', $attributeIds); + ->where('attribute_id IN (?)', $attributeIds, \Zend_Db::BIGINT_TYPE); $attributeIdentifiers = []; foreach ($context as $scope) { //TODO: if (in table exists context field) diff --git a/lib/internal/Magento/Framework/DB/Select.php b/lib/internal/Magento/Framework/DB/Select.php index ceeed40787123..f7ffece8fa3c0 100644 --- a/lib/internal/Magento/Framework/DB/Select.php +++ b/lib/internal/Magento/Framework/DB/Select.php @@ -113,7 +113,7 @@ public function where($cond, $value = null, $type = null) $type = null; } if (is_array($value)) { - $cond = $this->getConnection()->quoteInto($cond, $value); + $cond = $this->getConnection()->quoteInto($cond, $value, $type); $value = null; } return parent::where($cond, $value, $type); diff --git a/test.php b/test.php new file mode 100644 index 0000000000000..cb6a19e52b4ec --- /dev/null +++ b/test.php @@ -0,0 +1,28 @@ +getObjectManager(); + +$state = $om->get('Magento\Framework\App\State'); +$state->setAreaCode('frontend'); +$pc = $om->get(\Magento\Catalog\Model\ResourceModel\Product\Collection::class) + ->setPageSize(10) + ->load(); +var_dump($pc); + +// +///** @var \Magento\Eav\Model\Cache\Type $cache */ +//$cache = $om->get(\Magento\Eav\Model\Cache\Type::class); +//$i = 0; +//$d = 0; +//while (true) { +// echo '-\\|/'[$i % 4], "\r"; +// $key = "my_test_data" . $i++; +// $cache->save('data',$key , ['tag1', 'tag2' ], 1000); +// if ( 'data' !== $cache->load($key)) { +// $d ++; +// echo ' : Missread is - ' . number_format($d/$i, 2) , "\r"; +// } +//} \ No newline at end of file From 27e1c6ee41698a5b624fdb937018bde53a248705 Mon Sep 17 00:00:00 2001 From: Andrii Kasian Date: Mon, 2 Mar 2020 22:41:52 -0600 Subject: [PATCH 006/439] Explicitly define type for in condition --- .../Catalog/Model/Indexer/Category/Product/Action/Full.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Full.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Full.php index eee347c36910d..71bbc45d77532 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Full.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product/Action/Full.php @@ -282,7 +282,7 @@ private function reindexCategoriesBySelect(Select $basicSelect, $whereCondition, $this->connection->delete($this->tableMaintainer->getMainTmpTable((int)$store->getId())); $entityIds = $this->connection->fetchCol($query); $resultSelect = clone $basicSelect; - $resultSelect->where($whereCondition, $entityIds); + $resultSelect->where($whereCondition, $entityIds, \Zend_Db::BIGINT_TYPE); $this->connection->query( $this->connection->insertFromSelect( $resultSelect, From 4a22091f79ec0c551f2863f9053ed952b6cf6fcf Mon Sep 17 00:00:00 2001 From: Andrii Kasian Date: Mon, 2 Mar 2020 22:47:36 -0600 Subject: [PATCH 007/439] Explicitly define type for in condition --- .../Catalog/Model/Indexer/Category/Product/AbstractAction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php b/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php index b0aeea3230d70..b9433fda47235 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php +++ b/app/code/Magento/Catalog/Model/Indexer/Category/Product/AbstractAction.php @@ -503,7 +503,7 @@ protected function createAnchorSelect(Store $store) )->joinInner( ['cc2' => $temporaryTreeTable], $this->connection->quoteInto( - 'cc2.parent_id = cc.entity_id AND cc.entity_id NOT IN ()', + 'cc2.parent_id = cc.entity_id AND cc.entity_id NOT IN (?)', $rootCatIds, \Zend_Db::BIGINT_TYPE ), From a36c9a988c4fca9f9b525477976192000d3ce605 Mon Sep 17 00:00:00 2001 From: Andrii Kasian Date: Mon, 2 Mar 2020 22:53:10 -0600 Subject: [PATCH 008/439] Explicitly define type for in condition --- test.php | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 test.php diff --git a/test.php b/test.php deleted file mode 100644 index cb6a19e52b4ec..0000000000000 --- a/test.php +++ /dev/null @@ -1,28 +0,0 @@ -getObjectManager(); - -$state = $om->get('Magento\Framework\App\State'); -$state->setAreaCode('frontend'); -$pc = $om->get(\Magento\Catalog\Model\ResourceModel\Product\Collection::class) - ->setPageSize(10) - ->load(); -var_dump($pc); - -// -///** @var \Magento\Eav\Model\Cache\Type $cache */ -//$cache = $om->get(\Magento\Eav\Model\Cache\Type::class); -//$i = 0; -//$d = 0; -//while (true) { -// echo '-\\|/'[$i % 4], "\r"; -// $key = "my_test_data" . $i++; -// $cache->save('data',$key , ['tag1', 'tag2' ], 1000); -// if ( 'data' !== $cache->load($key)) { -// $d ++; -// echo ' : Missread is - ' . number_format($d/$i, 2) , "\r"; -// } -//} \ No newline at end of file From 1515252083346dc1db63961c22c35aff79b93ea3 Mon Sep 17 00:00:00 2001 From: Andrii Kasian Date: Mon, 9 Mar 2020 22:54:24 -0500 Subject: [PATCH 009/439] Update app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Product/Collection.php Co-Authored-By: Ihor Sviziev --- .../Product/Type/Configurable/Product/Collection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Product/Collection.php b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Product/Collection.php index d25423dd6e9d2..c8e761fb5ed22 100644 --- a/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Product/Collection.php +++ b/app/code/Magento/ConfigurableProduct/Model/ResourceModel/Product/Type/Configurable/Product/Collection.php @@ -84,7 +84,7 @@ protected function _renderFilters() $parentIds[] = $product->getData($metadata->getLinkField()); } - $this->getSelect()->where('link_table.parent_id in (?)', $parentIds,\Zend_Db::BIGINT_TYPE); + $this->getSelect()->where('link_table.parent_id in (?)', $parentIds, \Zend_Db::BIGINT_TYPE); return $this; } From de530f7be37c64617225ed428c269e34875bda23 Mon Sep 17 00:00:00 2001 From: Baljinder Hayre Date: Thu, 12 Mar 2020 16:33:48 +0000 Subject: [PATCH 010/439] #26288 Will now throw an exception when a customer does not exist who wants to reset password --- .../Customer/Model/ForgotPasswordToken/GetCustomerByToken.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Customer/Model/ForgotPasswordToken/GetCustomerByToken.php b/app/code/Magento/Customer/Model/ForgotPasswordToken/GetCustomerByToken.php index 09af4e296bd92..368770766f45a 100644 --- a/app/code/Magento/Customer/Model/ForgotPasswordToken/GetCustomerByToken.php +++ b/app/code/Magento/Customer/Model/ForgotPasswordToken/GetCustomerByToken.php @@ -73,7 +73,7 @@ public function execute(string $resetPasswordToken):CustomerInterface } if ($found->getTotalCount() === 0) { //Customer with such token not found. - new NoSuchEntityException( + throw new NoSuchEntityException( new Phrase( 'No such entity with rp_token = %value', [ From f44add27fbdd5e41023dc7994d13962d84eba69b Mon Sep 17 00:00:00 2001 From: Baljinder Hayre Date: Thu, 12 Mar 2020 16:33:48 +0000 Subject: [PATCH 011/439] #26288 Throw an exception when a customer does not exist requests password reset --- .../Customer/Model/ForgotPasswordToken/GetCustomerByToken.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/code/Magento/Customer/Model/ForgotPasswordToken/GetCustomerByToken.php b/app/code/Magento/Customer/Model/ForgotPasswordToken/GetCustomerByToken.php index 09af4e296bd92..211a71d827f7e 100644 --- a/app/code/Magento/Customer/Model/ForgotPasswordToken/GetCustomerByToken.php +++ b/app/code/Magento/Customer/Model/ForgotPasswordToken/GetCustomerByToken.php @@ -73,7 +73,7 @@ public function execute(string $resetPasswordToken):CustomerInterface } if ($found->getTotalCount() === 0) { //Customer with such token not found. - new NoSuchEntityException( + throw new NoSuchEntityException( new Phrase( 'No such entity with rp_token = %value', [ From 652971e5b1cdd6df545b6c8a99cd1c306b0a10d9 Mon Sep 17 00:00:00 2001 From: Alex Taranovsky Date: Sun, 22 Mar 2020 21:04:47 +0200 Subject: [PATCH 012/439] magento/magento2#: Add a new index for `cron_schedule` table --- app/code/Magento/Cron/etc/db_schema.xml | 4 ++++ app/code/Magento/Cron/etc/db_schema_whitelist.json | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/Cron/etc/db_schema.xml b/app/code/Magento/Cron/etc/db_schema.xml index 206b8f64f3ae7..c689baf0f4bca 100644 --- a/app/code/Magento/Cron/etc/db_schema.xml +++ b/app/code/Magento/Cron/etc/db_schema.xml @@ -28,5 +28,9 @@ + + + + diff --git a/app/code/Magento/Cron/etc/db_schema_whitelist.json b/app/code/Magento/Cron/etc/db_schema_whitelist.json index c8666896627e2..f0d6ebed8290f 100644 --- a/app/code/Magento/Cron/etc/db_schema_whitelist.json +++ b/app/code/Magento/Cron/etc/db_schema_whitelist.json @@ -12,10 +12,11 @@ }, "index": { "CRON_SCHEDULE_JOB_CODE": true, - "CRON_SCHEDULE_SCHEDULED_AT_STATUS": true + "CRON_SCHEDULE_SCHEDULED_AT_STATUS": true, + "CRON_SCHEDULE_SCHEDULE_ID_STATUS": true }, "constraint": { "PRIMARY": true } } -} \ No newline at end of file +} From 8f08efe13dfc83c5e7f5ee5c504ff3fd0781410f Mon Sep 17 00:00:00 2001 From: bradleybrecher Date: Sat, 21 Mar 2020 21:09:54 -0400 Subject: [PATCH 013/439] Add aria-atomic to messages appearing on storefront --- app/code/Magento/Theme/view/frontend/templates/messages.phtml | 4 ++-- app/code/Magento/Ui/view/frontend/web/template/messages.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/code/Magento/Theme/view/frontend/templates/messages.phtml b/app/code/Magento/Theme/view/frontend/templates/messages.phtml index dd9b81ecb38b9..e9fc4c65ec9e9 100644 --- a/app/code/Magento/Theme/view/frontend/templates/messages.phtml +++ b/app/code/Magento/Theme/view/frontend/templates/messages.phtml @@ -6,7 +6,7 @@ ?>
-