diff options
author | jocuri%softhome.net <> | 2004-12-31 16:52:21 +0100 |
---|---|---|
committer | jocuri%softhome.net <> | 2004-12-31 16:52:21 +0100 |
commit | 7f51d13817aecceac6e9a79155af37fc7614b683 (patch) | |
tree | db7527b2e5e006d0cbc0bfd797e6ec2e8a7167b6 | |
parent | c7c879f60a802fb2b3760cfb57510f47a0d25022 (diff) | |
download | bugzilla-7f51d13817aecceac6e9a79155af37fc7614b683.tar.gz bugzilla-7f51d13817aecceac6e9a79155af37fc7614b683.tar.xz |
Patch for bug 275523: Replace INNER JOIN in flag searches with LEFT JOIN; patch by me, r=joel, a=justdave.
-rw-r--r-- | Bugzilla/Search.pm | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 12f22b0e2..aaa2a12b9 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -730,17 +730,21 @@ sub init { } }, "^requestees.login_name," => sub { - push(@supptables, "flags flags_$chartid"); - push(@wherepart, "bugs.bug_id = flags_$chartid.bug_id"); - push(@supptables, "profiles requestees_$chartid"); - push(@wherepart, "flags_$chartid.requestee_id = requestees_$chartid.userid"); + my $flags = "flags_$chartid"; + push(@supptables, "LEFT JOIN flags $flags " . + "ON bugs.bug_id = $flags.bug_id " . + "AND $flags.is_active = 1"); + push(@supptables, "LEFT JOIN profiles requestees_$chartid " . + "ON $flags.requestee_id = requestees_$chartid.userid"); $f = "requestees_$chartid.login_name"; }, "^setters.login_name," => sub { - push(@supptables, "flags flags_$chartid"); - push(@wherepart, "bugs.bug_id = flags_$chartid.bug_id"); - push(@supptables, "profiles setters_$chartid"); - push(@wherepart, "flags_$chartid.setter_id = setters_$chartid.userid"); + my $flags = "flags_$chartid"; + push(@supptables, "LEFT JOIN flags $flags " . + "ON bugs.bug_id = $flags.bug_id " . + "AND $flags.is_active = 1"); + push(@supptables, "LEFT JOIN profiles setters_$chartid " . + "ON $flags.setter_id = setters_$chartid.userid"); $f = "setters_$chartid.login_name"; }, |