From: David Lawrence Date: Wed, 15 Jun 2011 19:33:22 +0000 (-0400) Subject: Bug 658929 - User autocomplete is very slow when there are lots of users in the profi... X-Git-Tag: bugzilla-4.0.2~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7199cb0db5aa2fb349165c9b841b607751fc42fd;p=thirdparty%2Fbugzilla.git Bug 658929 - User autocomplete is very slow when there are lots of users in the profiles table r=glob, a=mkanat --- diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index f81ed2b2f2..4aa05224fb 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -1243,7 +1243,7 @@ sub match { "AND group_id IN(" . join(', ', (-1, @{$user->visible_groups_inherited})) . ") "; } - $query .= " AND disabledtext = '' " if $exclude_disabled; + $query .= " AND LENGTH(disabledtext) = 0 " if $exclude_disabled; $query .= $dbh->sql_limit($limit) if $limit; # Execute the query, retrieve the results, and make them into @@ -1278,7 +1278,7 @@ sub match { " AND group_id IN(" . join(', ', (-1, @{$user->visible_groups_inherited})) . ") "; } - $query .= " AND disabledtext = '' " if $exclude_disabled; + $query .= " AND LENGTH(disabledtext) = 0 " if $exclude_disabled; $query .= $dbh->sql_limit($limit) if $limit; my $user_ids = $dbh->selectcol_arrayref($query, undef, ($str, $str)); @users = @{Bugzilla::User->new_from_list($user_ids)}; @@ -1696,7 +1696,7 @@ sub get_userlist { "AND group_id IN(" . join(', ', (-1, @{$self->visible_groups_inherited})) . ")"; } - $query .= " WHERE disabledtext = '' "; + $query .= " WHERE LENGTH(disabledtext) = 0 "; $query .= $dbh->sql_group_by('userid', 'login_name, realname'); my $sth = $dbh->prepare($query);