From 17952353911863f8b04db033b6c74afa540c7a07 Mon Sep 17 00:00:00 2001 From: dormando Date: Tue, 19 Jun 2012 22:01:23 -0700 Subject: [PATCH] Fix for integer overflow in mogstats on postgres by ch1qu1ta.lives on google. --- mogstats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mogstats b/mogstats index e2c5d52..ede22f1 100755 --- a/mogstats +++ b/mogstats @@ -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;