Commit 5bb248ef authored by Bernhard Posselt's avatar Bernhard Posselt
Browse files

Merge pull request #2764 from owncloud/remove-limit-from-count-query

Remove wrong limit parameter from count query in compatibility function
parents 74f90eab 142b020d
......@@ -1077,7 +1077,7 @@ class PDOStatementWrapper{
public function numRows() {
$regex = '/^SELECT\s+(?:ALL\s+|DISTINCT\s+)?(?:.*?)\s+FROM\s+(.*)$/i';
if (preg_match($regex, $this->statement->queryString, $output) > 0) {
$query = OC_DB::prepare("SELECT COUNT(*) FROM {$output[1]}", PDO::FETCH_NUM);
$query = OC_DB::prepare("SELECT COUNT(*) FROM {$output[1]}");
return $query->execute($this->lastArguments)->fetchColumn();
return $this->statement->rowCount();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment