summaryrefslogtreecommitdiffstats
path: root/extensions/BMO/lib
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-10-16 08:47:30 +0200
committerByron Jones <bjones@mozilla.com>2013-10-16 08:47:30 +0200
commit7aa4fa142c41ca7cb9c036e6747d78034bd6e69d (patch)
tree4b5f8a9ac398a669c3f8393db41219a8352dceaf /extensions/BMO/lib
parent57e9f86a58060ecbad9bc41d26d6998dccd11c69 (diff)
downloadbugzilla-7aa4fa142c41ca7cb9c036e6747d78034bd6e69d.tar.gz
bugzilla-7aa4fa142c41ca7cb9c036e6747d78034bd6e69d.tar.xz
Bug 926641: Release tracking report broken since 12-Oct BMO maintenance
Diffstat (limited to 'extensions/BMO/lib')
-rw-r--r--extensions/BMO/lib/Reports/ReleaseTracking.pm17
1 files changed, 11 insertions, 6 deletions
diff --git a/extensions/BMO/lib/Reports/ReleaseTracking.pm b/extensions/BMO/lib/Reports/ReleaseTracking.pm
index f9eabc340..5a07ae196 100644
--- a/extensions/BMO/lib/Reports/ReleaseTracking.pm
+++ b/extensions/BMO/lib/Reports/ReleaseTracking.pm
@@ -265,8 +265,13 @@ sub report {
push @params, '%' . $q->{flag_name} . $q->{flag_status} . '%';
}
- push @where, "(f.type_id IN (SELECT id FROM flagtypes WHERE name = ?))";
- push @params, $q->{flag_name};
+ my ($type_id) = $dbh->selectrow_array(
+ "SELECT id FROM flagtypes WHERE name = ?",
+ undef,
+ $q->{flag_name}
+ );
+ push @where, "(f.type_id = ?)";
+ push @params, $type_id;
push @where, "(f.status = ?)";
push @params, $q->{flag_status};
@@ -279,14 +284,14 @@ sub report {
if (scalar @{$q->{fields}}) {
my @fields;
foreach my $field (@{$q->{fields}}) {
- my $field_sql = "(" . ($field->{value} eq '+' ? '' : '!') . "(";
+ my $field_sql = "(";
if ($field->{type} == FIELD_TYPE_EXTENSION) {
- $field_sql .= "tf.name = " . $dbh->quote($field->{name}) . " AND tfb.value";
+ $field_sql .= "tf.name = " . $dbh->quote($field->{name}) . " AND COALESCE(tfb.value, '')";
}
else {
$field_sql .= "b." . $field->{name};
}
- $field_sql .= " IN ('fixed','verified')))";
+ $field_sql .= " " . ($field->{value} eq '+' ? '' : 'NOT ') . "IN ('fixed','verified'))";
push(@fields, $field_sql);
}
my $join = uc $q->{join};
@@ -299,7 +304,7 @@ sub report {
print "Content-Type: text/plain\n\n";
$query =~ s/\?/\000/g;
foreach my $param (@params) {
- $query =~ s/\000/$param/;
+ $query =~ s/\000/'$param'/;
}
print "$query\n";
exit;