dev/core#2360 - Escape the word `rows` in sql query
authorColeman Watts <coleman@civicrm.org>
Thu, 4 Feb 2021 23:10:42 +0000 (18:10 -0500)
committerColeman Watts <coleman@civicrm.org>
Thu, 4 Feb 2021 23:12:35 +0000 (18:12 -0500)
Civi/Api4/Query/Api4SelectQuery.php

index 20b8286e6dd095d81f1bc014ade2efe3af9172e8..3aacf3b1e5aa9fffd86646d3d4135f8a9d9bd883 100644 (file)
@@ -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);