Skip to content
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 regression from getSelectCountSql optimization when collection us… #3279

Merged
merged 4 commits into from
May 31, 2023

Conversation

colinmollenhour
Copy link
Member

See #2210

Skips optimization if bound parameters are found in any join conditions.

@colinmollenhour
Copy link
Member Author

Hold up.. this needs to account for the fact that bind params can be set with and without the leading ':'..

@colinmollenhour
Copy link
Member Author

Should be good now. 😄

kiatng
kiatng previously approved these changes May 29, 2023
Copy link
Contributor

@kiatng kiatng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested:

        $collection = Mage::getResourceModel('directory/region_collection');
        $collection->addBindParam('id2', 'MY');
        $collection->getSelect()->where('main_table.country_id = :id2');

        $sql = $collection->getSelectCountSql();

        $result = [
            $sql->__toString(),
            $collection->getSize(),
            $collection->toArray(),
        ]

@fballiano fballiano merged commit f8069c4 into OpenMage:main May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: lib/Varien Relates to lib/Varien Component: lib/* Relates to lib/*
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants