Closed Bug 301067 Opened 16 years ago Closed 16 years ago

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

Categories

(Bugzilla :: Bugzilla-General, defect)

2.20
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.22

People

(Reporter: LpSolit, Assigned: LpSolit)

References

Details

Attachments

(1 file)

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.
Target Milestone: --- → Bugzilla 2.20
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.
No longer blocks: bz-postgres
Blocks: meta-pg
Attached patch patch, v1Splinter Review
Assignee: general → LpSolit
Status: NEW → ASSIGNED
Attachment #201687 - Flags: review?(mkanat)
Comment on attachment 201687 [details] [diff] [review]
patch, v1

Yeah, if you've tested this, this looks right.
Attachment #201687 - Flags: review?(mkanat) → review+
Flags: approval?
Target Milestone: Bugzilla 2.20 → Bugzilla 2.22
Flags: approval? → approval+
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
Closed: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.