ACSD-48216: AUTO_INCREMENT of inventory_source_item table increases on UPDATE operation

The ACSD-48216 patch fixes the issue where AUTO_INCREMENT of the inventory_source_item table increases on the UPDATE operation. This patch is available when the Quality Patches Tool (QPT) 1.1.27 is installed. The patch ID is ACSD-48216. Please note that the issue is scheduled to be fixed in Adobe Commerce 2.4.7.

Affected products and versions

The patch is created for Adobe Commerce version:

  • Adobe Commerce (all deployment methods) 2.4.4

Compatible with Adobe Commerce versions:

  • Adobe Commerce (all deployment methods) 2.3.7 - 2.4.6
NOTE
The patch might become applicable to other versions with new Quality Patches Tool releases. To check if the patch is compatible with your Adobe Commerce version, update the 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

AUTO_INCREMENT of the inventory_source_item table increases on the UPDATE operation.

Steps to reproduce:

  1. Check the current value of AUTO_INCREMENT of the inventory_source_item table:
MySQL > show create table inventory_source_item;
CREATE TABLE `inventory_source_item` (
  `source_item_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `source_code` varchar(255) NOT NULL,
  `sku` varchar(64) NOT NULL,
  `quantity` decimal(12,4) NOT NULL DEFAULT '0.0000',
  `status` smallint(5) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`source_item_id`),
  UNIQUE KEY `INVENTORY_SOURCE_ITEM_SOURCE_CODE_SKU` (`source_code`,`sku`),
  KEY `INVENTORY_SOURCE_ITEM_SKU_SOURCE_CODE_QUANTITY` (`sku`,`source_code`,`quantity`),
  CONSTRAINT `INVENTORY_SOURCE_ITEM_SOURCE_CODE_INVENTORY_SOURCE_SOURCE_CODE` FOREIGN KEY (`source_code`) REFERENCES `inventory_source` (`source_code`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2048 DEFAULT CHARSET=utf8
  1. Make an API request for a specific product:

Endpoint: /rest/V1/inventory/source-items
Method: POST
Headers: Authorization: Bearer <admin_token>

Payload:

{
    "sourceItems": [
        {
            "sku": "24-MB01",
            "source_code": "default",
            "quantity": 200,
            "status": 1
        }
    ]
}
  1. Check the AUTO_INCREMENT value of the inventory_source_item table again.

Expected results:

The AUTO_INCREMENT value of the inventory_source_item table does not increase after every update operation.

Actual results:

The AUTO_INCREMENT value of the inventory_source_item table increases after every update operation.

Apply the patch

To apply individual patches, use the following links depending on your deployment method:

To learn more about Quality Patches Tool, refer to:

For info about other patches available in QPT, refer to Quality Patches Tool: Search for patches in the Quality Patches Tool guide.

recommendation-more-help
8bd06ef0-b3d5-4137-b74e-d7b00485808a