From 87739bfac96d2ed1cbaed86b3ada7785667e8463 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Thu, 17 Jul 2025 11:02:12 +0200 Subject: [PATCH] fix: no OFFSET set when LIMIT is an integer --- src/MySQL.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/MySQL.php b/src/MySQL.php index 074df8c..1dff427 100644 --- a/src/MySQL.php +++ b/src/MySQL.php @@ -163,17 +163,8 @@ return $this; } - // Set LIMIT without range directly as integer - if (is_int($limit)) { - $this->limit = $limit; - return $this; - } - - // No offset defined, set limit property directly as string - if (is_null($offset)) { - $this->limit = (string) $limit; - return $this; - } + // Coerce offset to zero if no offset is defined + $offset = $offset ?? 0; // Set limit and offset as SQL CSV $this->limit = "{$offset},{$limit}";