diff --git a/core/lib/Drupal/Core/Database/Statement.php b/core/lib/Drupal/Core/Database/Statement.php index ca70c4c..418c327 100644 --- a/core/lib/Drupal/Core/Database/Statement.php +++ b/core/lib/Drupal/Core/Database/Statement.php @@ -123,7 +123,7 @@ public function rowCount() { return parent::rowCount(); } else { - throw new RowCountException(); + throw new RowCountException('rowCount() is not allowed for SELECT queries. Query: ' . $this->getQueryString()); } } diff --git a/core/lib/Drupal/Core/Database/StatementEmpty.php b/core/lib/Drupal/Core/Database/StatementEmpty.php index e6cd08d..8f4b8c4 100644 --- a/core/lib/Drupal/Core/Database/StatementEmpty.php +++ b/core/lib/Drupal/Core/Database/StatementEmpty.php @@ -40,7 +40,7 @@ public function rowCount() { if ($this->allowRowCount) { return 0; } - throw new RowCountException(); + throw new RowCountException('rowCount() is not allowed for SELECT queries.'); } public function setFetchMode($mode, $a1 = NULL, $a2 = array()) {