diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index b0e086e65c..8cb5f5f970 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -1079,7 +1079,7 @@ class acp_attachments $attachments_per_page = (int) $config['topics_per_page']; // Get total number or orphans older than 3 hours - $sql = 'SELECT COUNT(attach_id) as num_files, SUM(filesize) as total_size + $sql = 'SELECT COUNT(attach_id) as num_files, SUM(' . $this->db->cast_expr_to_bigint('filesize') . ') as total_size FROM ' . ATTACHMENTS_TABLE . ' WHERE is_orphan = 1 AND filetime < ' . (time() - 3*60*60); diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 920214448d..abd622fe9d 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -2048,7 +2048,7 @@ class acp_forums $config->set('num_files', (int) $row['stat'], false); - $sql = 'SELECT SUM(filesize) as stat + $sql = 'SELECT SUM(' . $db->cast_expr_to_bigint('filesize') . ') as stat FROM ' . ATTACHMENTS_TABLE; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index b29e3f7ad1..83df4dc073 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -189,7 +189,7 @@ class acp_main $config->set('num_files', (int) $db->sql_fetchfield('stat'), false); $db->sql_freeresult($result); - $sql = 'SELECT SUM(filesize) as stat + $sql = 'SELECT SUM(' . $db->cast_expr_to_bigint('filesize') . ') as stat FROM ' . ATTACHMENTS_TABLE . ' WHERE is_orphan = 0'; $result = $db->sql_query($sql); diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index cf2a659d77..8a161edfa7 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -1845,7 +1845,7 @@ function update_dynamic_config() $config->set('num_files', (int) $db->sql_fetchfield('stat'), false); $db->sql_freeresult($result); - $sql = 'SELECT SUM(filesize) as stat + $sql = 'SELECT SUM(' . $db->cast_expr_to_bigint('filesize') . ') as stat FROM ' . ATTACHMENTS_TABLE . ' WHERE is_orphan = 0'; $result = $db->sql_query($sql);