Skip to content

Commit

Permalink
Merge pull request #19535 from colemanw/escapeRows
Browse files Browse the repository at this point in the history
dev/core#2360 - Escape the word `rows` in sql query
  • Loading branch information
monishdeb authored Feb 5, 2021
2 parents 0436a94 + b95c187 commit 445e4ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Civi/Api4/Query/Api4SelectQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function getCount() {
$this->buildHavingClause();
$this->buildGroupBy();
$subquery = $this->query->toSQL();
$sql = "SELECT count(*) AS `c` FROM ( $subquery ) AS rows";
$sql = "SELECT count(*) AS `c` FROM ( $subquery ) AS `rows`";
}
$this->debug('sql', $sql);
return (int) \CRM_Core_DAO::singleValueQuery($sql);
Expand Down

0 comments on commit 445e4ab

Please sign in to comment.