From: Tim Düsterhus Date: Wed, 17 Jun 2015 17:52:38 +0000 (+0200) Subject: Fix LIMIT in UPDATE statements X-Git-Tag: 3.0.0_Beta_1~2269 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a686b6b83397f8deb0842dea52c55c17210057f8;p=GitHub%2FWoltLab%2FWCF.git Fix LIMIT in UPDATE statements As of now the OFFSET will be omitted, if zero. --- diff --git a/wcfsetup/install/files/lib/system/database/Database.class.php b/wcfsetup/install/files/lib/system/database/Database.class.php index b98283578b..bf319f9fb9 100644 --- a/wcfsetup/install/files/lib/system/database/Database.class.php +++ b/wcfsetup/install/files/lib/system/database/Database.class.php @@ -244,7 +244,7 @@ abstract class Database { */ public function handleLimitParameter($query, $limit = 0, $offset = 0) { if ($limit != 0) { - $query .= " LIMIT " . $limit . " OFFSET " . $offset; + $query .= " LIMIT " . $limit . ($offset ? " OFFSET " . $offset : ''); } return $query;