Skip to content

Commit

Permalink
Fix for integer overflow in mogstats on postgres
Browse files Browse the repository at this point in the history
by ch1qu1ta.lives on google.
  • Loading branch information
dormando committed Jun 20, 2012
1 parent 285332a commit 1795235
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mogstats
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ sub stats_for_devices {
}

sub stats_for_files_sql {
my $sql = 'SELECT dmid, classid, COUNT(classid), sum(length), sum(length::int4 * devcount::int4) FROM file GROUP BY 1, 2';
my $sql = 'SELECT dmid, classid, COUNT(classid), sum(length), sum(length::int8 * devcount::int8) FROM file GROUP BY 1, 2';
return $sql if ($DB_TYPE eq 'Postgres');
$sql =~ s/::int4//g;
return $sql;
Expand Down

0 comments on commit 1795235

Please sign in to comment.