Fix bustage on Oracle due to bug 898830

git-svn-id: svn://10.0.0.236/trunk@264991 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzrmirror%bugzilla.org 2013-09-02 00:52:51 +00:00
parent 957efb8ca7
commit 0c1b57d002
2 changed files with 3 additions and 3 deletions

View File

@ -1 +1 @@
8721
8722

View File

@ -684,13 +684,13 @@ sub get_attachments_by_bug {
# Preload datasizes.
my $sizes =
$dbh->selectall_hashref('SELECT attach_id, LENGTH(thedata) AS size
$dbh->selectall_hashref('SELECT attach_id, LENGTH(thedata) AS datasize
FROM attachments LEFT JOIN attach_data ON attach_id = id
WHERE bug_id = ?',
'attach_id', undef, $bug->id);
# Force the size of attachments not in the DB to be recalculated.
$_->{datasize} = $sizes->{$_->id}->{size} || undef foreach @$attachments;
$_->{datasize} = $sizes->{$_->id}->{datasize} || undef foreach @$attachments;
}
return $attachments;
}