-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #23077: Fix condition Safe-NULL condition on Update Trigger #23294
Fix #23077: Fix condition Safe-NULL condition on Update Trigger #23294
Conversation
Hi @sebastien-kathmandu. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
For people looking at this PR there is also this logic in a Catalog Staging class in the Commerce version |
Hi @sebastien-kathmandu did you review the functional test that failed? Regards |
Yep any update on why the test failed? I have this fix on prod 2.3.1 ^^. It seems to be working fine... Thanks |
Hi @seyuf and @rodrigowebjump , I saw the test failing, and I don't know too why this test fail, I need to setup this functional test on my local to understand why. If anyone has an idea, I would be happy to get any clue ;-) . I'm wondering if an other part also of indexing has an issue and that would explain this test failing. Cheers, Sebastien |
@magento run all tests |
Hi @sivaschenko, thank you for the review.
|
@sebastien-kathmandu thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
It looks like Magento core devs fixed this as well very recently in MC-19407: Number of the rows increase very fast in changelog table |
@hostep indeed, thanks for the notification. @sebastien-kathmandu thank you very much for the pull request, your contribution is appreciated! However, as you can see the issue has already been fixed so I have to close this pull request. |
Hi @sebastien-kathmandu, thank you for your contribution! |
Description (*)
Safe-NULL in the Update Trigger created by View is used in the wrong way. As we are using an external integration system using INSERT INTO ... ON DUPLICATE KEY UPDATE
value
= ... on most on our product ( for example stock, prices, varchar attribute) each integration is followed by a reindex of most of our products that are not really updated. And impact a lot the performances of our database.Fixed Issues (if relevant)
Manual testing scenarios (*)
To understand the condition used before and after the commit df5597a2e and the solution proposed in this Pull Request.
I'm doing this benchmark playground :
here the result of the last query:
Before
as we can see before the commit the NULL condition could cause a lot of trouble if for example a previous attribute were NULL or become NULL as change the
After
Only if the both value are the same we got
true
.if we look a classic line in a trigger for example :
trg_catalog_product_entity_int_after_update
if at least one of these fields (
value_id
,attribute_id
,store_id
,row_id
,value
) didn't change we will always insert a new row insidecatalog_product_flat_cl
. And this is always the case.Contribution checklist (*)