diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index 2c4d5136236..e4fc0b3c2f8 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -8721 \ No newline at end of file +8722 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/Attachment.pm b/mozilla/webtools/bugzilla/Bugzilla/Attachment.pm index 7e758c87454..251363c35c9 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Attachment.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Attachment.pm @@ -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; }