fix: no OFFSET set when LIMIT is an integer

This commit is contained in:
Victor Westerlund 2025-07-17 11:02:12 +02:00
parent e062930c41
commit 87739bfac9
Signed by: vlw
GPG key ID: D0AD730E1057DFC6

View file

@ -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}";