SQL query fixed
authorMarcel Werk <burntime@woltlab.com>
Wed, 12 Oct 2011 18:07:35 +0000 (20:07 +0200)
committerMarcel Werk <burntime@woltlab.com>
Wed, 12 Oct 2011 18:07:35 +0000 (20:07 +0200)
query wasn't compatible with PostgreSQL

wcfsetup/install/files/lib/data/package/Package.class.php

index 0eea3bdd5e6dc177192e0ae5fa40d8a4a26f8c6a..48e397e53c7ef946ca39564d7c912fa0df0a8122 100644 (file)
@@ -496,7 +496,7 @@ class Package extends DatabaseObject {
                $currentPrefix = strtoupper(Package::getAbbreviation($package->package));
                
                // get dependencies (only standalones)
-               $sql = "SELECT          package.*, IF(package.packageID = ?, 1, 0) AS sortOrder
+               $sql = "SELECT          package.*, CASE WHEN package.packageID = ? THEN 1 ELSE 0 END AS sortOrder 
                        FROM            wcf".WCF_N."_package_dependency package_dependency
                        LEFT JOIN       wcf".WCF_N."_package package
                        ON              (package.packageID = package_dependency.dependency)