[PostgreSQL] editusers.cgi doesn't do a case-insensitive comparison

RESOLVED FIXED in Bugzilla 2.22

Status

()

RESOLVED FIXED
13 years ago
13 years ago

People

(Reporter: LpSolit, Assigned: LpSolit)

Tracking

2.20
Bugzilla 2.22
Bug Flags:
approval +

Details

Attachments

(1 attachment)

(Assignee)

Description

13 years ago
editusers.cgi says "case-insensitive substring", but PostgreSQL clearly doesn't
do that, see lines 111-121:

            $query .= " $nextCondition profiles.login_name ";
            if ($matchtype eq 'regexp') {
                $query .= $dbh->sql_regexp . ' ?';
                $matchstr = '.' unless $matchstr;
            } elsif ($matchtype eq 'notregexp') {
                $query .= $dbh->sql_not_regexp . ' ?';
                $matchstr = '.' unless $matchstr;
            } else { # substr or unknown
                $query .= 'like ?';
                $matchstr = "%$matchstr%";
            }

This part was missed by bug 285695.

If it's not a performance issue, we could remove the substring part completely
and do a regexp by default, which is really case-insensitive, even in Pg.
(Assignee)

Updated

13 years ago
Target Milestone: --- → Bugzilla 2.20

Comment 1

13 years ago
Hrm. Honestly, I wouldn't particularly mind removing substring searches and
replacing them entirely with regex searches, for this. However, we may have to
add them back in some day if we want to support a DB without a REGEX operator.
(As unlikely *cough*Sybase*cough* as that may be.)

We could also use sql_istrcmp, which would easily solve the problem in this case.

Updated

13 years ago
No longer blocks: 98304
(Assignee)

Updated

13 years ago
Blocks: 314490
(Assignee)

Comment 2

13 years ago
Created attachment 201687 [details] [diff] [review]
patch, v1
Assignee: general → LpSolit
Status: NEW → ASSIGNED
Attachment #201687 - Flags: review?(mkanat)

Comment 3

13 years ago
Comment on attachment 201687 [details] [diff] [review]
patch, v1

Yeah, if you've tested this, this looks right.
Attachment #201687 - Flags: review?(mkanat) → review+
(Assignee)

Updated

13 years ago
Flags: approval?
Target Milestone: Bugzilla 2.20 → Bugzilla 2.22
Flags: approval? → approval+
(Assignee)

Comment 4

13 years ago
Checking in editusers.cgi;
/cvsroot/mozilla/webtools/bugzilla/editusers.cgi,v  <--  editusers.cgi
new revision: 1.108; previous revision: 1.107
done
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.