From: Frédéric Buclin Date: Mon, 2 Sep 2013 00:35:18 +0000 (+0200) Subject: Fix bustage on Oracle due to bug 898830 X-Git-Tag: bugzilla-4.5.1~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=738cacaa640160fddbe82e3216e7ea5fcf65efa1;p=thirdparty%2Fbugzilla.git Fix bustage on Oracle due to bug 898830 --- diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm index 7e758c8745..251363c35c 100644 --- a/Bugzilla/Attachment.pm +++ b/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; }