Commit 738cacaa authored by Frédéric Buclin's avatar Frédéric Buclin

Fix bustage on Oracle due to bug 898830

parent 94cd0aae
...@@ -684,13 +684,13 @@ sub get_attachments_by_bug { ...@@ -684,13 +684,13 @@ sub get_attachments_by_bug {
# Preload datasizes. # Preload datasizes.
my $sizes = 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 FROM attachments LEFT JOIN attach_data ON attach_id = id
WHERE bug_id = ?', WHERE bug_id = ?',
'attach_id', undef, $bug->id); 'attach_id', undef, $bug->id);
# Force the size of attachments not in the DB to be recalculated. # 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; return $attachments;
} }
......
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