Fixed SQL query
authorMarcel Werk <burntime@woltlab.com>
Thu, 11 Jul 2013 18:00:25 +0000 (20:00 +0200)
committerMarcel Werk <burntime@woltlab.com>
Thu, 11 Jul 2013 18:00:25 +0000 (20:00 +0200)
wcfsetup/install/files/lib/data/attachment/AdministrativeAttachmentList.class.php

index be3b5d896b63cbf9913f7bca4c9332edb319b6f9..58bcd52d382096acde889458014431b73faeddaa 100644 (file)
@@ -76,8 +76,8 @@ class AdministrativeAttachmentList extends AttachmentList {
         */
        public function getStats() {
                $sql = "SELECT  COUNT(*) AS count,
-                               IFNULL(SUM(attachment.filesize), 0) AS size,
-                               IFNULL(SUM(downloads), 0) AS downloads
+                               COALESCE(SUM(attachment.filesize), 0) AS size,
+                               COALESCE(SUM(downloads), 0) AS downloads
                        FROM    wcf".WCF_N."_attachment attachment
                        ".$this->getConditionBuilder();
                $statement = WCF::getDB()->prepareStatement($sql);