From bc7607c1c4e31b9583a6a772c41567c1b1928e6d Mon Sep 17 00:00:00 2001 From: "bugreport%peshkin.net" <> Date: Sat, 27 Aug 2005 06:11:30 +0000 Subject: Bug 305333: Move attachments.thedata to its own table Patch by Joel Peshkin r=lpsolit, a=justdave --- Bugzilla/Search.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Bugzilla/Search.pm') diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index f30fe733b..64342d17c 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -756,6 +756,19 @@ sub init { "ON groups_$chartid.id = bug_group_map_$chartid.group_id"); $f = "groups_$chartid.name"; }, + "^attach_data\.thedata," => sub { + my $atable = "attachments_$chartid"; + my $dtable = "attachdata_$chartid"; + my $extra = ""; + if (Param("insidergroup") && !UserInGroup(Param("insidergroup"))) { + $extra = "AND $atable.isprivate = 0"; + } + push(@supptables, "INNER JOIN attachments AS $atable " . + "ON bugs.bug_id = $atable.bug_id $extra"); + push(@supptables, "INNER JOIN attach_data AS $dtable " . + "ON $dtable.id = $atable.attach_id"); + $f = "$dtable.thedata"; + }, "^attachments\..*," => sub { my $table = "attachments_$chartid"; my $extra = ""; -- cgit v1.2.3-24-g4f1b