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

CRM-19811 fix one instance of referring to LOWER() & comment others. #9596

Merged
merged 3 commits into from
Jan 9, 2017

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Dec 30, 2016

I have tested & removed the current_employer reference & added notes to other references to LOWER. I will track down & remove the one relating to credit notes in the next round


I have tested & removed the current_employer reference & added notes to other references to LOWER. I will track down & remove the one relating to credit notes in the next round
@eileenmcnaughton
Copy link
Contributor Author

I have only changed the 2 instances of LOWER for which I have written unit tests and commented all the rest. I am pretty confident in my analysis that they can all go but have limited myself to commenting the others for now so they can be removed later

$query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause($wc, $op, $value, $dataType);
$query->_qill[$grouping][] = "$whereTable[title] $op $quoteValue";
list($tableName, $fieldName) = explode('.', $whereTable['where'], 2);
list($tableName) = explode('.', $whereTable['where'], 2);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

$fieldName is not used anywhere - minor tidy up

Also fix historical sql to guard against copy & paste
…s (e.g. creditnote_id).

Add unit test to demonstrate case sensitivity still respected
@eileenmcnaughton
Copy link
Contributor Author

I can offer some quid-pro-quo review on this if anyone wants to review it

@ErichBSchulz
Copy link
Contributor

ErichBSchulz commented Jan 2, 2017

this looks sound to me (for what that is worth!) - is there some kind of check in the installation code or admin panel that verifies that mysql is configured to case-insensitive text match?

something like SELECT if('ok' = 'OK', 'we are good', 'warning you need to adjust your MySQL configuration to do case-insensitive searching or things will break')

@eileenmcnaughton
Copy link
Contributor Author

Well the installation code specifies the table creation & in that it specifics the Collation - any collation ending in _ci is case insensitive. So, the only way I think someone could be other than case insensitive is if they have deliberately changed their Collation from the default - and I don't think we have to be responsible for every possible hack someone may have done

@eileenmcnaughton
Copy link
Contributor Author

(ie. collation is set per table / field)

@ErichBSchulz
Copy link
Contributor

oh. right. well that takes care of the only gotcha I could think of :-)

only other thought was is there a convention for tagging comments with FIXME ? vim highlights my FIXMEs and TODOs but I'm not sure if that is a thing...

@eileenmcnaughton
Copy link
Contributor Author

We follow the drupal coding standards for those things

https://www.drupal.org/docs/develop/coding-standards/api-documentation-and-comment-standards#todo

@ErichBSchulz
Copy link
Contributor

cool - no fixme then. worth a todo? (btw, I'm still wrestling with getting my proper tools operational but hopefully I'll be in a position to help expand unit test coverage soonish)

@colemanw
Copy link
Member

colemanw commented Jan 9, 2017

@eileenmcnaughton I'll take you up on your quid-pro-quo offer... how about this one while we're on the topic of efficiency? #9623

@colemanw colemanw merged commit ee73cf3 into civicrm:master Jan 9, 2017
@eileenmcnaughton eileenmcnaughton deleted the performance branch January 10, 2017 10:04
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.

4 participants