diff options
author | Perl Tidy <perltidy@bugzilla.org> | 2018-12-05 21:38:52 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-12-05 23:49:08 +0100 |
commit | 8ec8da0491ad89604700b3e29a227966f6d84ba1 (patch) | |
tree | 9d270f173330ca19700e0ba9f2ee931300646de1 /scripts/fix-attachment-sizes.pl | |
parent | a7bb5a65b71644d9efce5fed783ed545b9336548 (diff) | |
download | bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.gz bugzilla-8ec8da0491ad89604700b3e29a227966f6d84ba1.tar.xz |
no bug - reformat all the code using the new perltidy rules
Diffstat (limited to 'scripts/fix-attachment-sizes.pl')
-rwxr-xr-x | scripts/fix-attachment-sizes.pl | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/scripts/fix-attachment-sizes.pl b/scripts/fix-attachment-sizes.pl index 6c5a3a39c..c946d49ca 100755 --- a/scripts/fix-attachment-sizes.pl +++ b/scripts/fix-attachment-sizes.pl @@ -21,21 +21,22 @@ Bugzilla->usage_mode(USAGE_MODE_CMDLINE); my $dbh = Bugzilla->dbh; $dbh->bz_start_transaction(); -my $attachment_sizes = $dbh->selectall_arrayref(q{ +my $attachment_sizes = $dbh->selectall_arrayref( + q{ SELECT attachments.attach_id, length(thedata) FROM attach_data INNER JOIN attachments ON attachments.attach_id = attach_data.id WHERE attachments.attach_size != 0 AND attachments.mimetype = 'image/png' - AND length(thedata) != attachments.attach_size }); + AND length(thedata) != attachments.attach_size } +); say "Found ", scalar @$attachment_sizes, " attachments to fix"; foreach my $attachment_size (@$attachment_sizes) { - say "Setting size for $attachment_size->[0] to $attachment_size->[1]"; + say "Setting size for $attachment_size->[0] to $attachment_size->[1]"; - $dbh->do("UPDATE attachments SET attach_size = ? WHERE attach_id = ?", undef, - $attachment_size->[1], - $attachment_size->[0]); + $dbh->do("UPDATE attachments SET attach_size = ? WHERE attach_id = ?", + undef, $attachment_size->[1], $attachment_size->[0]); } -$dbh->bz_commit_transaction();
\ No newline at end of file +$dbh->bz_commit_transaction(); |