Skip to content

Commit 5bc3e26

Browse files
committed
check empty limit
1 parent 6f85826 commit 5bc3e26

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/Database/Adapter/SQL.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3331,11 +3331,11 @@ public function count(Document $collection, array $queries = [], ?int $max = nul
33313331
? 'WHERE ' . \implode(' AND ', $where)
33323332
: '';
33333333

3334-
if (\is_null($max)) {
3334+
if (empty($limit)) {
33353335
$sql = "
3336-
SELECT COUNT(1) as sum
3337-
FROM {$this->getSQLTable($name)} AS {$this->quote($alias)}
3338-
{$sqlWhere}
3336+
SELECT COUNT(1) as sum
3337+
FROM {$this->getSQLTable($name)} AS {$this->quote($alias)}
3338+
{$sqlWhere}
33393339
";
33403340
} else {
33413341
$sql = "
@@ -3425,7 +3425,7 @@ public function sum(Document $collection, string $attribute, array $queries = []
34253425
? 'WHERE ' . \implode(' AND ', $where)
34263426
: '';
34273427

3428-
if (\is_null($max)) {
3428+
if (empty($limit)) {
34293429
$sql = "
34303430
SELECT SUM({$this->quote($attribute)}) as sum
34313431
FROM {$this->getSQLTable($name)} AS {$this->quote($alias)}

0 commit comments

Comments
 (0)