-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Mview Indexers getList should return integer values of id's and not strings #22920
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
Mview Indexers getList should return integer values of id's and not strings #22920
Conversation
Hi @mhodge13. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mhodge13,
Thank you for your contribution!
I want to say that you are digging really interesting topic.
However I would like to ask you clarify exact case how described by you issue can be reproduced.
Could you also clarify which version of Magento you have used to reproduce this issue?
I have made small research and I have found that since 2.2.8 return of this function is converted to int in
$ids = array_map('intval', $this->getChangelog()->getList($versionFrom, $versionTo)); |
Also these changes are present in 2.3.1:
$ids = array_map('intval', $this->getChangelog()->getList($vsFrom, $versionTo)); |
But your fix I like more your fix, because it force \Magento\Framework\Mview\View\ChangelogInterface::getList to follow described contract in PHPDOC.
Lets check together:
- Have your issue was reproduced (or can be reproduced) on version which I mentioned?
- If your issue was fixed in 2.2.8/2.3.1 - I would like propose to replace fix which was done in
lib/internal/Magento/Framework/Mview/View.php:288 with your changes. Then please revert changes in this line and fix all failed tests in build.
Hi @swnsma The version that was causing this issue is in Magento 2.2.7. It seems that the changes in 2.2.8 and 2.3.1 do in fact fix this issue. I was checking the PHPDOC as well and saw that the return value of the function should in fact be integers. I will revert the other changes and recommit to trigger the checks again. Some of the issues found during the static tests were not changes made by me. Do you want me to fix those as well? |
Hi @mhodge13, |
@swnsma Everything is passing now except a banned keyword in the Static Test Build Can you let me know how you want me to fix this one please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @mhodge13,
We almost done.
Please check and fix my minor notices.
lib/internal/Magento/Framework/Mview/Test/Unit/View/ChangelogTest.php
Outdated
Show resolved
Hide resolved
@swnsma Can you please review the Unit Test build issue since it is calling out a js error and the static test issue is because of a banned word ("changelog"). Thanks, Mark |
Hi @swnsma, thank you for the review. |
QA Passed ✔️ |
…d's and not strings magento#22920
Hi @mhodge13, thank you for your contribution! |
Description (*)
When using Maria DB I have noticed that when the
indexer_update_all_views
cron job runs that some of the indexer queries have a mix of entity_id values that are strings and some that are integers. When running a describe on the query I have confirmed that Maria DB will look at every row in the table and not use the entity_id values that are in the WHERE clause. This does not seem to be an issue when using MySql but is in an issue when using Maria DB.Manual testing scenarios (*)
When reviewing the queries for the
catalog_product_attribute
indexer I saw a mix of string and integer id values.Run a describe on the query, notice mix of string and integer
DESC DELETE FROM
catalog_product_index_eav
WHERE (entity_id IN('2764369', 2766213));rows returned shows all rows in table: 9,133,650 and Extra shows "Using Where"
Run the same query but change the entity_ids to be integers
DESC DELETE FROM
catalog_product_index_eav
WHERE (entity_id IN(2764369, 2766213));rows returned shows only 23 rows and Extran shows "Using Where"
Maria DB version tested on: 10.1.38-MariaDB-1~xenial mariadb.org binary distribution