Commit 157112a5 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 300549: Eliminate deprecated Bugzilla::DB routines from Flag.pm and…

Bug 300549: Eliminate deprecated Bugzilla::DB routines from Flag.pm and FlagType.pm - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wicked a=justdave
parent 7640676d
...@@ -36,17 +36,12 @@ See below for more information. ...@@ -36,17 +36,12 @@ See below for more information.
=item * =item *
Prior to calling routines in this module, it's assumed that you have
already done a C<require globals.pl>.
=item *
Import relevant functions from that script. Import relevant functions from that script.
=item * =item *
Use of private functions / variables outside this module may lead to Use of private functions / variables outside this module may lead to
unexpected results after an upgrade. Please avoid usi8ng private unexpected results after an upgrade. Please avoid using private
functions in other files/modules. Private functions are functions functions in other files/modules. Private functions are functions
whose names start with _ or a re specifically noted as being private. whose names start with _ or a re specifically noted as being private.
...@@ -78,44 +73,17 @@ use Bugzilla::Field; ...@@ -78,44 +73,17 @@ use Bugzilla::Field;
# Global Variables # Global Variables
###################################################################### ######################################################################
# basic sets of columns and tables for getting flags from the database use constant DB_COLUMNS => qw(
flags.id
=begin private flags.type_id
flags.bug_id
=head1 PRIVATE VARIABLES/CONSTANTS flags.attach_id
flags.requestee_id
=over flags.setter_id
flags.status
=item C<@base_columns> );
basic sets of columns and tables for getting flag types from th
database. B<Used by get, match, sqlify_criteria and perlify_record>
=cut
my @base_columns =
("id", "type_id", "bug_id", "attach_id", "requestee_id",
"setter_id", "status");
=pod
=item C<@base_tables>
Which database(s) is the data coming from?
Note: when adding tables to @base_tables, make sure to include the separator
(i.e. words like "LEFT OUTER JOIN") before the table name, since tables take
multiple separators based on the join type, and therefore it is not possible
to join them later using a single known separator.
B<Used by get, match, sqlify_criteria and perlify_record>
=back
=end private
=cut my $columns = join(", ", DB_COLUMNS);
my @base_tables = ("flags");
###################################################################### ######################################################################
# Searching/Retrieving Flags # Searching/Retrieving Flags
...@@ -133,20 +101,14 @@ Retrieves and returns a flag from the database. ...@@ -133,20 +101,14 @@ Retrieves and returns a flag from the database.
=cut =cut
# !!! Implement a cache for this function!
sub get { sub get {
my ($id) = @_; my ($id) = @_;
my $dbh = Bugzilla->dbh;
my $select_clause = "SELECT " . join(", ", @base_columns); my @flag = $dbh->selectrow_array("SELECT $columns FROM flags
my $from_clause = "FROM " . join(" ", @base_tables); WHERE id = ?", undef, $id);
# Execute the query, retrieve the result, and write it into a record.
&::PushGlobalSQLState();
&::SendSQL("$select_clause $from_clause WHERE flags.id = $id");
my $flag = perlify_record(&::FetchSQLData());
&::PopGlobalSQLState();
return $flag; return perlify_record(@flag);
} }
=pod =pod
...@@ -165,23 +127,18 @@ and returns an array of matching records. ...@@ -165,23 +127,18 @@ and returns an array of matching records.
sub match { sub match {
my ($criteria) = @_; my ($criteria) = @_;
my $dbh = Bugzilla->dbh;
my $select_clause = "SELECT " . join(", ", @base_columns);
my $from_clause = "FROM " . join(" ", @base_tables);
my @criteria = sqlify_criteria($criteria); my @criteria = sqlify_criteria($criteria);
$criteria = join(' AND ', @criteria);
my $where_clause = "WHERE " . join(" AND ", @criteria); my $flags = $dbh->selectall_arrayref("SELECT $columns FROM flags
WHERE $criteria");
# Execute the query, retrieve the results, and write them into records.
&::PushGlobalSQLState();
&::SendSQL("$select_clause $from_clause $where_clause");
my @flags; my @flags;
while (&::MoreSQLData()) { foreach my $flag (@$flags) {
my $flag = perlify_record(&::FetchSQLData()); push(@flags, perlify_record(@$flag));
push(@flags, $flag);
} }
&::PopGlobalSQLState();
return \@flags; return \@flags;
} }
...@@ -202,16 +159,12 @@ and returns an array of matching records. ...@@ -202,16 +159,12 @@ and returns an array of matching records.
sub count { sub count {
my ($criteria) = @_; my ($criteria) = @_;
my $dbh = Bugzilla->dbh;
my @criteria = sqlify_criteria($criteria); my @criteria = sqlify_criteria($criteria);
$criteria = join(' AND ', @criteria);
my $where_clause = "WHERE " . join(" AND ", @criteria); my $count = $dbh->selectrow_array("SELECT COUNT(*) FROM flags WHERE $criteria");
# Execute the query, retrieve the result, and write it into a record.
&::PushGlobalSQLState();
&::SendSQL("SELECT COUNT(id) FROM flags $where_clause");
my $count = &::FetchOneColumn();
&::PopGlobalSQLState();
return $count; return $count;
} }
...@@ -431,9 +384,7 @@ sub process { ...@@ -431,9 +384,7 @@ sub process {
# Use the date/time we were given if possible (allowing calling code # Use the date/time we were given if possible (allowing calling code
# to synchronize the comment's timestamp with those of other records). # to synchronize the comment's timestamp with those of other records).
# XXX - we shouldn't quote the timestamp here, but this would involve $timestamp ||= $dbh->selectrow_array('SELECT NOW()');
# many changes in this file.
$timestamp = ($timestamp ? &::SqlQuote($timestamp) : "NOW()");
# Take a snapshot of flags before any changes. # Take a snapshot of flags before any changes.
my @old_summaries = snapshot($bug_id, $attach_id); my @old_summaries = snapshot($bug_id, $attach_id);
...@@ -486,23 +437,20 @@ sub process { ...@@ -486,23 +437,20 @@ sub process {
sub update_activity { sub update_activity {
my ($bug_id, $attach_id, $timestamp, $old_summaries, $new_summaries) = @_; my ($bug_id, $attach_id, $timestamp, $old_summaries, $new_summaries) = @_;
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
my $user_id = Bugzilla->user->id;
$attach_id ||= 'NULL';
$old_summaries = join(", ", @$old_summaries); $old_summaries = join(", ", @$old_summaries);
$new_summaries = join(", ", @$new_summaries); $new_summaries = join(", ", @$new_summaries);
my ($removed, $added) = diff_strings($old_summaries, $new_summaries); my ($removed, $added) = diff_strings($old_summaries, $new_summaries);
if ($removed ne $added) { if ($removed ne $added) {
my $sql_removed = &::SqlQuote($removed);
my $sql_added = &::SqlQuote($added);
my $field_id = get_field_id('flagtypes.name'); my $field_id = get_field_id('flagtypes.name');
$dbh->do("INSERT INTO bugs_activity $dbh->do('INSERT INTO bugs_activity
(bug_id, attach_id, who, bug_when, fieldid, removed, added) (bug_id, attach_id, who, bug_when, fieldid, removed, added)
VALUES ($bug_id, $attach_id, $user_id, $timestamp, VALUES (?, ?, ?, ?, ?, ?, ?)',
$field_id, $sql_removed, $sql_added)"); undef, ($bug_id, $attach_id, Bugzilla->user->id,
$timestamp, $field_id, $removed, $added));
$dbh->do("UPDATE bugs SET delta_ts = $timestamp WHERE bug_id = ?", $dbh->do('UPDATE bugs SET delta_ts = ? WHERE bug_id = ?',
undef, $bug_id); undef, ($timestamp, $bug_id));
} }
} }
...@@ -520,23 +468,19 @@ Creates a flag record in the database. ...@@ -520,23 +468,19 @@ Creates a flag record in the database.
sub create { sub create {
my ($flag, $timestamp) = @_; my ($flag, $timestamp) = @_;
my $dbh = Bugzilla->dbh;
my $attach_id;
$attach_id = $flag->{target}->{attachment}->{id} if $flag->{target}->{attachment};
my $requestee_id;
$requestee_id = $flag->{'requestee'}->id if $flag->{'requestee'};
my $attach_id = $dbh->do('INSERT INTO flags (type_id, bug_id, attach_id, requestee_id,
$flag->{target}->{attachment} ? $flag->{target}->{attachment}->{id} setter_id, status, creation_date, modification_date)
: "NULL"; VALUES (?, ?, ?, ?, ?, ?, ?, ?)',
my $requestee_id = $flag->{'requestee'} ? $flag->{'requestee'}->id : "NULL"; undef, ($flag->{'type'}->{'id'}, $flag->{'target'}->{'bug'}->{'id'},
$attach_id, $requestee_id, $flag->{'setter'}->id,
&::SendSQL("INSERT INTO flags (type_id, bug_id, attach_id, $flag->{'status'}, $timestamp, $timestamp));
requestee_id, setter_id, status,
creation_date, modification_date)
VALUES ($flag->{'type'}->{'id'},
$flag->{'target'}->{'bug'}->{'id'},
$attach_id,
$requestee_id,
" . $flag->{'setter'}->id . ",
'$flag->{'status'}',
$timestamp,
$timestamp)");
# Send an email notifying the relevant parties about the flag creation. # Send an email notifying the relevant parties about the flag creation.
if ($flag->{'requestee'} if ($flag->{'requestee'}
...@@ -552,33 +496,6 @@ sub create { ...@@ -552,33 +496,6 @@ sub create {
=over =over
=item C<migrate($old_attach_id, $new_attach_id, $timestamp)>
Moves a flag from one attachment to another. Useful for migrating
a flag from an obsolete attachment to the attachment that obsoleted it.
=back
=cut
sub migrate {
my ($old_attach_id, $new_attach_id, $timestamp) = @_;
# Use the date/time we were given if possible (allowing calling code
# to synchronize the comment's timestamp with those of other records).
$timestamp = ($timestamp ? &::SqlQuote($timestamp) : "NOW()");
# Update the record in the flags table to point to the new attachment.
&::SendSQL("UPDATE flags " .
"SET attach_id = $new_attach_id , " .
" modification_date = $timestamp " .
"WHERE attach_id = $old_attach_id");
}
=pod
=over
=item C<modify($cgi, $timestamp)> =item C<modify($cgi, $timestamp)>
Modifies flags in the database when a user changes them. Modifies flags in the database when a user changes them.
...@@ -590,6 +507,7 @@ Modifies flags in the database when a user changes them. ...@@ -590,6 +507,7 @@ Modifies flags in the database when a user changes them.
sub modify { sub modify {
my ($cgi, $timestamp) = @_; my ($cgi, $timestamp) = @_;
my $setter = Bugzilla->user; my $setter = Bugzilla->user;
my $dbh = Bugzilla->dbh;
# Extract a list of flags from the form data. # Extract a list of flags from the form data.
my @ids = map(/^flag-(\d+)$/ ? $1 : (), $cgi->param()); my @ids = map(/^flag-(\d+)$/ ? $1 : (), $cgi->param());
...@@ -653,18 +571,16 @@ sub modify { ...@@ -653,18 +571,16 @@ sub modify {
next unless ($status_changed || $requestee_changed); next unless ($status_changed || $requestee_changed);
# Since the status is validated, we know it's safe, but it's still # Since the status is validated, we know it's safe, but it's still
# tainted, so we have to detaint it before using it in a query. # tainted, so we have to detaint it before using it in a query.
&::trick_taint($status); trick_taint($status);
if ($status eq '+' || $status eq '-') { if ($status eq '+' || $status eq '-') {
&::SendSQL("UPDATE flags $dbh->do('UPDATE flags
SET setter_id = " . $setter->id . ", SET setter_id = ?, requestee_id = NULL,
requestee_id = NULL , status = ?, modification_date = ?
status = '$status' , WHERE id = ?',
modification_date = $timestamp undef, ($setter->id, $status, $timestamp, $flag->{'id'}));
WHERE id = $flag->{'id'}");
# If the status of the flag was "?", we have to notify # If the status of the flag was "?", we have to notify
# the requester (if he wants to). # the requester (if he wants to).
...@@ -687,7 +603,7 @@ sub modify { ...@@ -687,7 +603,7 @@ sub modify {
} }
elsif ($status eq '?') { elsif ($status eq '?') {
# Get the requestee, if any. # Get the requestee, if any.
my $requestee_id = "NULL"; my $requestee_id;
if ($requestee_email) { if ($requestee_email) {
$requestee_id = login_to_id($requestee_email); $requestee_id = login_to_id($requestee_email);
$flag->{'requestee'} = new Bugzilla::User($requestee_id); $flag->{'requestee'} = new Bugzilla::User($requestee_id);
...@@ -699,12 +615,12 @@ sub modify { ...@@ -699,12 +615,12 @@ sub modify {
} }
# Update the database with the changes. # Update the database with the changes.
&::SendSQL("UPDATE flags $dbh->do('UPDATE flags
SET setter_id = " . $setter->id . ", SET setter_id = ?, requestee_id = ?,
requestee_id = $requestee_id , status = ?, modification_date = ?
status = '$status' , WHERE id = ?',
modification_date = $timestamp undef, ($setter->id, $requestee_id, $status,
WHERE id = $flag->{'id'}"); $timestamp, $flag->{'id'}));
# Now update the flag object with its new values. # Now update the flag object with its new values.
$flag->{'setter'} = $setter; $flag->{'setter'} = $setter;
...@@ -867,28 +783,22 @@ Returns a hash of information about a target bug. ...@@ -867,28 +783,22 @@ Returns a hash of information about a target bug.
# until that one gets rewritten. # until that one gets rewritten.
sub GetBug { sub GetBug {
my ($id) = @_; my ($id) = @_;
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
# Save the currently running query (if any) so we do not overwrite it. my $bug = $dbh->selectrow_hashref('SELECT 1 AS existence, bugs.bug_id AS id,
&::PushGlobalSQLState(); short_desc AS summary,
product_id, component_id,
&::SendSQL("SELECT 1, short_desc, product_id, component_id, COUNT(bug_group_map.group_id) AS restricted
COUNT(bug_group_map.group_id) FROM bugs
FROM bugs LEFT JOIN bug_group_map LEFT JOIN bug_group_map
ON (bugs.bug_id = bug_group_map.bug_id) ON bugs.bug_id = bug_group_map.bug_id
WHERE bugs.bug_id = $id " . WHERE bugs.bug_id = ? ' .
$dbh->sql_group_by('bugs.bug_id', $dbh->sql_group_by('bugs.bug_id',
'short_desc, product_id, component_id')); 'short_desc, product_id, component_id'),
undef, $id);
my $bug = { 'id' => $id };
($bug->{'exists'}, $bug->{'summary'}, $bug->{'product_id'},
$bug->{'component_id'}, $bug->{'restricted'}) = &::FetchSQLData();
# Restore the previously running query (if any).
&::PopGlobalSQLState();
# 'exists' is a reserved word in MySQL.
$bug->{'exists'} = $bug->{'existence'};
return $bug; return $bug;
} }
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
# Rights Reserved. # Rights Reserved.
# #
# Contributor(s): Myk Melez <myk@mozilla.org> # Contributor(s): Myk Melez <myk@mozilla.org>
# Frédéric Buclin <LpSolit@gmail.com>
=head1 NAME =head1 NAME
...@@ -34,11 +35,6 @@ See below for more information. ...@@ -34,11 +35,6 @@ See below for more information.
=item * =item *
Prior to calling routines in this module, it's assumed that you have
already done a C<require globals.pl>.
=item *
Use of private functions/variables outside this module may lead to Use of private functions/variables outside this module may lead to
unexpected results after an upgrade. Please avoid using private unexpected results after an upgrade. Please avoid using private
functions in other files/modules. Private functions are functions functions in other files/modules. Private functions are functions
...@@ -131,17 +127,14 @@ Returns a hash of information about a flag type. ...@@ -131,17 +127,14 @@ Returns a hash of information about a flag type.
sub get { sub get {
my ($id) = @_; my ($id) = @_;
my $dbh = Bugzilla->dbh;
my $select_clause = "SELECT " . join(", ", @base_columns); my $columns = join(", ", @base_columns);
my $from_clause = "FROM " . join(" ", @base_tables);
&::PushGlobalSQLState(); my @data = $dbh->selectrow_array("SELECT $columns FROM flagtypes
&::SendSQL("$select_clause $from_clause WHERE flagtypes.id = $id"); WHERE id = ?", undef, $id);
my @data = &::FetchSQLData();
my $type = perlify_record(@data);
&::PopGlobalSQLState();
return $type; return perlify_record(@data);
} }
=pod =pod
...@@ -261,16 +254,12 @@ sub match { ...@@ -261,16 +254,12 @@ sub match {
if $include_count; if $include_count;
$query .= " ORDER BY flagtypes.sortkey, flagtypes.name"; $query .= " ORDER BY flagtypes.sortkey, flagtypes.name";
# Execute the query and retrieve the results. my $flagtypes = $dbh->selectall_arrayref($query);
&::PushGlobalSQLState();
&::SendSQL($query);
my @types; my @types;
while (&::MoreSQLData()) { foreach my $flagtype (@$flagtypes) {
my @data = &::FetchSQLData(); push(@types, perlify_record(@$flagtype));
my $type = perlify_record(@data);
push(@types, $type);
} }
&::PopGlobalSQLState();
return \@types; return \@types;
} }
...@@ -289,22 +278,16 @@ Returns the total number of flag types matching the given criteria. ...@@ -289,22 +278,16 @@ Returns the total number of flag types matching the given criteria.
sub count { sub count {
my ($criteria) = @_; my ($criteria) = @_;
my $dbh = Bugzilla->dbh;
# Generate query components.
my @tables = @base_tables; my @tables = @base_tables;
my @criteria = sqlify_criteria($criteria, \@tables); my @criteria = sqlify_criteria($criteria, \@tables);
# The way tables are joined is already included in @tables.
my $tables = join(' ', @tables);
$criteria = join(' AND ', @criteria);
# Build the query. my $count = $dbh->selectrow_array("SELECT COUNT(flagtypes.id) FROM $tables
my $select_clause = "SELECT COUNT(flagtypes.id)"; WHERE $criteria");
my $from_clause = "FROM " . join(" ", @tables);
my $where_clause = "WHERE " . join(" AND ", @criteria);
my $query = "$select_clause $from_clause $where_clause";
# Execute the query and get the results.
&::PushGlobalSQLState();
&::SendSQL($query);
my $count = &::FetchOneColumn();
&::PopGlobalSQLState();
return $count; return $count;
} }
...@@ -462,11 +445,12 @@ still exist after a change to the inclusions/exclusions lists. ...@@ -462,11 +445,12 @@ still exist after a change to the inclusions/exclusions lists.
sub normalize { sub normalize {
# A list of IDs of flag types to normalize. # A list of IDs of flag types to normalize.
my (@ids) = @_; my (@ids) = @_;
my $dbh = Bugzilla->dbh;
my $ids = join(", ", @ids); my $ids = join(", ", @ids);
# Check for flags whose product/component is no longer included. # Check for flags whose product/component is no longer included.
&::SendSQL(" my $flag_ids = $dbh->selectcol_arrayref("
SELECT flags.id SELECT flags.id
FROM (flags INNER JOIN bugs ON flags.bug_id = bugs.bug_id) FROM (flags INNER JOIN bugs ON flags.bug_id = bugs.bug_id)
LEFT OUTER JOIN flaginclusions AS i LEFT OUTER JOIN flaginclusions AS i
...@@ -474,20 +458,24 @@ sub normalize { ...@@ -474,20 +458,24 @@ sub normalize {
AND (bugs.product_id = i.product_id OR i.product_id IS NULL) AND (bugs.product_id = i.product_id OR i.product_id IS NULL)
AND (bugs.component_id = i.component_id OR i.component_id IS NULL)) AND (bugs.component_id = i.component_id OR i.component_id IS NULL))
WHERE flags.type_id IN ($ids) WHERE flags.type_id IN ($ids)
AND i.type_id IS NULL AND i.type_id IS NULL");
");
Bugzilla::Flag::clear(&::FetchOneColumn()) while &::MoreSQLData(); foreach my $flag_id (@$flag_ids) {
Bugzilla::Flag::clear($flag_id);
}
&::SendSQL(" $flag_ids = $dbh->selectcol_arrayref("
SELECT flags.id SELECT flags.id
FROM flags, bugs, flagexclusions AS e FROM flags, bugs, flagexclusions AS e
WHERE flags.type_id IN ($ids) WHERE flags.type_id IN ($ids)
AND flags.bug_id = bugs.bug_id AND flags.bug_id = bugs.bug_id
AND flags.type_id = e.type_id AND flags.type_id = e.type_id
AND (bugs.product_id = e.product_id OR e.product_id IS NULL) AND (bugs.product_id = e.product_id OR e.product_id IS NULL)
AND (bugs.component_id = e.component_id OR e.component_id IS NULL) AND (bugs.component_id = e.component_id OR e.component_id IS NULL)");
");
Bugzilla::Flag::clear(&::FetchOneColumn()) while &::MoreSQLData(); foreach my $flag_id (@$flag_ids) {
Bugzilla::Flag::clear($flag_id);
}
} }
###################################################################### ######################################################################
...@@ -513,6 +501,7 @@ by the query. ...@@ -513,6 +501,7 @@ by the query.
sub sqlify_criteria { sub sqlify_criteria {
my ($criteria, $tables) = @_; my ($criteria, $tables) = @_;
my $dbh = Bugzilla->dbh;
# the generated list of SQL criteria; "1=1" is a clever way of making sure # the generated list of SQL criteria; "1=1" is a clever way of making sure
# there's something in the list so calling code doesn't have to check list # there's something in the list so calling code doesn't have to check list
...@@ -520,13 +509,13 @@ sub sqlify_criteria { ...@@ -520,13 +509,13 @@ sub sqlify_criteria {
my @criteria = ("1=1"); my @criteria = ("1=1");
if ($criteria->{name}) { if ($criteria->{name}) {
push(@criteria, "flagtypes.name = " . &::SqlQuote($criteria->{name})); push(@criteria, "flagtypes.name = " . $dbh->quote($criteria->{name}));
} }
if ($criteria->{target_type}) { if ($criteria->{target_type}) {
# The target type is stored in the database as a one-character string # The target type is stored in the database as a one-character string
# ("a" for attachment and "b" for bug), but this function takes complete # ("a" for attachment and "b" for bug), but this function takes complete
# names ("attachment" and "bug") for clarity, so we must convert them. # names ("attachment" and "bug") for clarity, so we must convert them.
my $target_type = &::SqlQuote(substr($criteria->{target_type}, 0, 1)); my $target_type = $dbh->quote(substr($criteria->{target_type}, 0, 1));
push(@criteria, "flagtypes.target_type = $target_type"); push(@criteria, "flagtypes.target_type = $target_type");
} }
if (exists($criteria->{is_active})) { if (exists($criteria->{is_active})) {
......
...@@ -1045,7 +1045,7 @@ sub insert ...@@ -1045,7 +1045,7 @@ sub insert
foreach my $obsolete_id (@obsolete_ids) { foreach my $obsolete_id (@obsolete_ids) {
# If the obsolete attachment has request flags, cancel them. # If the obsolete attachment has request flags, cancel them.
# This call must be done before updating the 'attachments' table. # This call must be done before updating the 'attachments' table.
Bugzilla::Flag::CancelRequests($bugid, $obsolete_id, $dbh->quote($timestamp)); Bugzilla::Flag::CancelRequests($bugid, $obsolete_id, $timestamp);
$dbh->do("UPDATE attachments SET isobsolete = 1 " . $dbh->do("UPDATE attachments SET isobsolete = 1 " .
"WHERE attach_id = ?", undef, $obsolete_id); "WHERE attach_id = ?", undef, $obsolete_id);
......
...@@ -580,8 +580,7 @@ if ($action eq 'search') { ...@@ -580,8 +580,7 @@ if ($action eq 'search') {
my @new_summaries = Bugzilla::Flag::snapshot($bug_id, $attach_id); my @new_summaries = Bugzilla::Flag::snapshot($bug_id, $attach_id);
# Let update_activity do all the dirty work, including setting # Let update_activity do all the dirty work, including setting
# the bug timestamp. # the bug timestamp.
Bugzilla::Flag::update_activity($bug_id, $attach_id, Bugzilla::Flag::update_activity($bug_id, $attach_id, $timestamp,
$dbh->quote($timestamp),
\@old_summaries, \@new_summaries); \@old_summaries, \@new_summaries);
$updatedbugs{$bug_id} = 1; $updatedbugs{$bug_id} = 1;
} }
......
...@@ -751,7 +751,7 @@ BugCheck("bugs LEFT JOIN duplicates ON bugs.bug_id = duplicates.dupe WHERE " . ...@@ -751,7 +751,7 @@ BugCheck("bugs LEFT JOIN duplicates ON bugs.bug_id = duplicates.dupe WHERE " .
Status("Checking statuses/resolutions"); Status("Checking statuses/resolutions");
my @open_states = map(SqlQuote($_), BUG_STATE_OPEN); my @open_states = map($dbh->quote($_), BUG_STATE_OPEN);
my $open_states = join(', ', @open_states); my $open_states = join(', ', @open_states);
BugCheck("bugs WHERE bug_status IN ($open_states) AND resolution != ''", BugCheck("bugs WHERE bug_status IN ($open_states) AND resolution != ''",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment