User matching shouldn't be case-sensitive

RESOLVED FIXED in Bugzilla 2.18

Status

()

RESOLVED FIXED
16 years ago
6 years ago

People

(Reporter: justdave, Assigned: myk)

Tracking

2.17
Bugzilla 2.18

Details

Attachments

(1 attachment, 2 obsolete attachments)

On bugzilla-tip on landfill (with usermatchtype in params set to "search" rather
than "wildcard"), I entered "miller" in the CC field on a bug and hit Commit.

I was prompted with several choices, none of which were me.  The ones I got all
had "miller" as part of their email address as well.

I went back and changed it to "Miller" and this time it found me.
(Assignee)

Updated

16 years ago
Blocks: 176570

Comment 1

16 years ago
Created attachment 104787 [details] [diff] [review]
Changes INSTR in queries to LIKE for case insensitivity

INSTR in mysql < 4.0 is case-sensitive, while LIKE is not.

Per a brief discussion on #mozwebtools, this patch moves substring searches to
LIKE rather than INSTR.
(Assignee)

Comment 2

16 years ago
Comment on attachment 104787 [details] [diff] [review]
Changes INSTR in queries to LIKE for case insensitivity

Works, r=myk.  It's trivial, but I want bbaetz to look it over too, since he
was the one who suggested INSTR as I recall, so wait for his second r= before
checking this in.
Attachment #104787 - Flags: review+
(Assignee)

Comment 3

16 years ago
Also you should fix the comment on line 138 to say something like "# then try
sub-string search".

Comment 4

16 years ago
Created attachment 104795 [details] [diff] [review]
Same as before, but removes mention of instr

Removed INSTR from comments.
Attachment #104787 - Attachment is obsolete: true
You need to escape literal \, %, and _ if you use LIKE. sqlquote does \, but not
the others.

I don't reacall mentioning using substring, but istm that it would be faster
than LIKE. The correct way to do case insensitive substring stuff is to do
SUBSTRING(TOUPPER(foo), $bar).
(where $bar is capitalised in advance in perl)

Comment 7

16 years ago
Created attachment 105093 [details] [diff] [review]
Case-insensitive INSTR

That's absolutely a better way of doing it.  I presume you meant INSTR rather
than SUBSTRING.
Attachment #104795 - Attachment is obsolete: true
Comment on attachment 105093 [details] [diff] [review]
Case-insensitive INSTR

2xr= justdave

Tested on landfill, it works.

a= justdave for checkin during 2.17.1 freeze
Attachment #105093 - Flags: review+

Comment 9

16 years ago
Checked in for not_erik

Checking in Bugzilla/User.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/User.pm,v  <--  User.pm
new revision: 1.6; previous revision: 1.5
done
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED

Updated

16 years ago
Target Milestone: --- → Bugzilla 2.18
I did, yes

pg doesn't have INSTR, so you should use: |position($bar in toupper(foo)) > 0|
which is standard sql. Except that oracle doesn't appear to have 'position', so
leave it as is, and we'll deal with it later.
Target Milestone: Bugzilla 2.18 → ---
oops...
Target Milestone: --- → Bugzilla 2.18
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.