Skip to content

SQL error on 2.4.4 prerelease when saving a product with new source and stock #35262

Closed
@MargoKep

Description

@MargoKep

Preconditions (*)

  1. Magento 2.4.4 prerelease
  2. PHP 8.1
  3. Magento with prefix in DB

Steps to reproduce (*)
1.Create new source
2.Create new stock and assign for new source
4. Going to: Catalog-->Product--> Open random product, Assigning for new Source, add Q-ty
5. Push the Save button

Expected result (*)

  1. Success after save wtihout error, and seeing on the Products Greed Q-ty >0 in column Stock

Actual result (*)

  1. SQL Error and on the Products Grid in column Stock=0 and not displaying on FrontArea:
    https://imgur.com/a/Mj7vS0x https://imgur.com/a/POWJtKH
    SQLSTATE[42S02]: Base table or view not found: 1146 Table 'docker_mg244eegolaya.pref_reservations_temp_for_stock_2' doesn't exist, query was: SELECT source_item.sku, SUM(IF(source_item.status = 0, 0, source_item.quantity)) AS quantity, IF((reservations.reservation_qty IS NULL OR (SUM(source_item.quantity) + reservations.reservation_qty) > 0) AND (((legacy_stock_item.use_config_backorders = 0 AND legacy_stock_item.backorders <> 0) AND (legacy_stock_item.min_qty >= 0 OR legacy_stock_item.qty > legacy_stock_item.min_qty) AND SUM(IF(source_item.status = 0, 0, 1))) OR ((legacy_stock_item.use_config_manage_stock = 0 AND legacy_stock_item.manage_stock = 0)) OR ((legacy_stock_item.use_config_min_qty = 1 AND SUM(IF(source_item.status = 0, 0, source_item.quantity)) > 0) OR (legacy_stock_item.use_config_min_qty = 0 AND SUM(IF(source_item.status = 0, 0, source_item.quantity)) > legacy_stock_item.min_qty)) OR (product.sku IS NULL)), 1, 0) AS is_salable FROM pref_inventory_source_item AS source_item LEFT JOIN pref_catalog_product_entity AS product ON product.sku = source_item.sku AND (product.created_in <= 1 AND product.updated_in > 1) LEFT JOIN pref_cataloginventory_stock_item AS legacy_stock_item ON product.entity_id = legacy_stock_item.product_id LEFT JOIN pref_reservations_temp_for_stock_2 AS reservations ON source_item.sku = reservations.sku WHERE (source_item.source_code IN ('a2')) AND (source_item.sku IN ('24-MB01')) GROUP BY source_item.sku

Severity (*) S0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: FrameworkIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P0This generally occurs in cases when the entire functionality is blocked.Progress: doneReported on 2.4.4Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions