From a686b6b83397f8deb0842dea52c55c17210057f8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 17 Jun 2015 19:52:38 +0200 Subject: [PATCH] Fix LIMIT in UPDATE statements As of now the OFFSET will be omitted, if zero. --- wcfsetup/install/files/lib/system/database/Database.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.20.1