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

Further removal of instance of using LOWER() rather than relying on mysql non-case-sensitivity. #12612

Merged
merged 1 commit into from
Aug 4, 2018

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

This is part of a phased process of removing LOWER from core mysql queries. So far we are only aware of downsides to using it but out of cautiousness are removing it slowly over releases

Before

Calls to filter on email_greeting, postal_greeting, address have LOWER applied (resulting in unindexed searches)

After

LOWER not applied, mysql case insensitive search relied on

Technical Details

Per #12494 & # 12503 the use of LOWER

hurts performance
fails to return results on some char sets
messes with REGEX

This is part of a continued (we removed from contribution search fields last year)
staggered approach to removing this old mechanism

Comments

Note I could not find any way to hit this line of code so I added deprecation notices. I looked in advanced search, search builder, api explorer & I created a search profile per the screen shot

screenshot 2018-08-02 14 06 11

@civibot
Copy link

civibot bot commented Aug 2, 2018

(Standard links)

@eileenmcnaughton
Copy link
Contributor Author

test this please

@@ -2253,6 +2255,7 @@ public function restWhere(&$values) {
);
}
elseif ($name === 'addressee') {
CRM_Core_Error::deprecatedFunctionWarning('pass in addressee_id or ddressee_display');
Copy link
Member

Choose a reason for hiding this comment

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

typo in "ddressee_display"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah - but probably no-one will ever see that notice again until they go to remove the code....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@colemanw ok - fixed

@eileenmcnaughton
Copy link
Contributor Author

test this please

@eileenmcnaughton
Copy link
Contributor Author

@monishdeb @seamuslee001 @lcdservices @colemanw this passed - am wondering if anyone else can figure out a way to hit these deprecation notices or whether it's truly dead code.

I think this is mergeable as we have proven the concept of removing 'LOWER' we are just actioning it conservatively

@eileenmcnaughton
Copy link
Contributor Author

opps I can see a comment to remove - that will trigger tests again :-(

…ysql non-case-sensitivity.

Note I could not find any way to call this so I added deprecation notices

Per civicrm#12494 the use of LOWER

hurts performance
fails to return results on some char sets
messes with REGEX
This is part of a continued (we removed from contribution search fields last year)
staggered approach to removing this old mechanism
@colemanw colemanw merged commit dfeca6f into civicrm:master Aug 4, 2018
@colemanw colemanw deleted the more_lower branch August 4, 2018 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants