Skip to content

Commit

Permalink
fix: LIMIT & OFFSET are not supported with replacing select count(*) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
priyadi authored Sep 7, 2024
1 parent b07d6df commit 3285771
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

# 0.17.1

* fix: LIMIT & OFFSET are not supported with replacing select count(*)

# 0.17.0

* feat: DBAL adapter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,11 @@ private function doCount(

$sql = $queryBuilder->getSQL();

if (!str_contains(strtoupper($sql), 'GROUP BY')) {
if (
!str_contains(strtoupper($sql), ' GROUP BY ') &&
!str_contains(strtoupper($sql), ' LIMIT ') &&
!str_contains(strtoupper($sql), ' OFFSET ')
) {
return $this->doCountWithReplacingSelect($queryBuilder);
}

Expand Down

0 comments on commit 3285771

Please sign in to comment.