mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Bug 99716 - allow query for Attachment is obsolete AND Attachment Status. Patch by myk, r=justdave, jake.
This commit is contained in:
parent
60781554cb
commit
1a265b9fa1
@ -336,6 +336,8 @@ sub GenerateSQL {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $chartid;
|
my $chartid;
|
||||||
|
# $statusid is used by the code that queries for attachment statuses.
|
||||||
|
my $statusid = 0;
|
||||||
my $f;
|
my $f;
|
||||||
my $ff;
|
my $ff;
|
||||||
my $t;
|
my $t;
|
||||||
@ -389,7 +391,8 @@ sub GenerateSQL {
|
|||||||
},
|
},
|
||||||
"^attachments\..*," => sub {
|
"^attachments\..*," => sub {
|
||||||
my $table = "attachments_$chartid";
|
my $table = "attachments_$chartid";
|
||||||
push(@supptables, "LEFT JOIN attachments $table ON bugs.bug_id = $table.bug_id");
|
push(@supptables, "attachments $table");
|
||||||
|
push(@wherepart, "bugs.bug_id = $table.bug_id");
|
||||||
$f =~ m/^attachments\.(.*)$/;
|
$f =~ m/^attachments\.(.*)$/;
|
||||||
my $field = $1;
|
my $field = $1;
|
||||||
if ($t eq "changedby") {
|
if ($t eq "changedby") {
|
||||||
@ -408,19 +411,32 @@ sub GenerateSQL {
|
|||||||
$field = "creation_ts";
|
$field = "creation_ts";
|
||||||
$t = "greaterthan";
|
$t = "greaterthan";
|
||||||
}
|
}
|
||||||
if ($field eq "ispatch") {
|
if ($field eq "ispatch" && $v ne "0" && $v ne "1") {
|
||||||
if ($v ne "0" && $v ne "1") {
|
return Error("The only legal values for the 'Attachment is patch' " .
|
||||||
return Error("The only legal values for the 'Attachment is patch' field is 0 or 1.");
|
"field are 0 and 1.");
|
||||||
}
|
}
|
||||||
|
if ($field eq "isobsolete" && $v ne "0" && $v ne "1") {
|
||||||
|
return Error("The only legal values for the 'Attachment is obsolete' " .
|
||||||
|
"field are 0 and 1.");
|
||||||
}
|
}
|
||||||
$f = "$table.$field";
|
$f = "$table.$field";
|
||||||
},
|
},
|
||||||
# 2001-05-16 myk@mozilla.org: enable querying against attachment status
|
# 2001-05-16 myk@mozilla.org: enable querying against attachment status
|
||||||
# if this installation has enabled use of the attachment tracker.
|
# if this installation has enabled use of the attachment tracker.
|
||||||
"^attachstatusdefs.name," => sub {
|
"^attachstatusdefs.name," => sub {
|
||||||
|
# When searching for multiple statuses within a single boolean chart,
|
||||||
|
# we want to match each status record separately. In other words,
|
||||||
|
# "status = 'foo' AND status = 'bar'" should match attachments with
|
||||||
|
# one status record equal to "foo" and another one equal to "bar",
|
||||||
|
# not attachments where the same status record equals both "foo" and
|
||||||
|
# "bar" (which is nonsensical). In order to do this we must add an
|
||||||
|
# additional counter to the end of the "attachstatuses" and
|
||||||
|
# "attachstatusdefs" table references.
|
||||||
|
++$statusid;
|
||||||
|
|
||||||
my $attachtable = "attachments_$chartid";
|
my $attachtable = "attachments_$chartid";
|
||||||
my $statustable = "attachstatuses_$chartid";
|
my $statustable = "attachstatuses_${chartid}_$statusid";
|
||||||
my $statusdefstable = "attachstatusdefs_$chartid";
|
my $statusdefstable = "attachstatusdefs_${chartid}_$statusid";
|
||||||
push(@supptables, "attachments $attachtable");
|
push(@supptables, "attachments $attachtable");
|
||||||
push(@supptables, "attachstatuses $statustable");
|
push(@supptables, "attachstatuses $statustable");
|
||||||
push(@supptables, "attachstatusdefs $statusdefstable");
|
push(@supptables, "attachstatusdefs $statusdefstable");
|
||||||
|
Loading…
Reference in New Issue
Block a user