From b95c18767e0fa47114b9019c47ecdffdbe73f137 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 4 Feb 2021 18:10:42 -0500 Subject: [PATCH] dev/core#2360 - Escape the word `rows` in sql query --- Civi/Api4/Query/Api4SelectQuery.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Civi/Api4/Query/Api4SelectQuery.php b/Civi/Api4/Query/Api4SelectQuery.php index 20b8286e6d..3aacf3b1e5 100644 --- a/Civi/Api4/Query/Api4SelectQuery.php +++ b/Civi/Api4/Query/Api4SelectQuery.php @@ -164,7 +164,7 @@ class Api4SelectQuery { $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); -- 2.25.1