rhtyd commented on a change in pull request #3457: Fix bug in counting items
for search query
URL: https://github.com/apache/cloudstack/pull/3457#discussion_r299801665
##########
File path: framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java
##########
@@ -2055,7 +2046,17 @@ public Integer getCount(SearchCriteria<T> sc) {
@DB()
protected StringBuilder createCountSelect(SearchCriteria<?> sc, final
boolean whereClause) {
- StringBuilder sql = new StringBuilder(_count);
+ if (sc == null)
+ return null;
+
+ StringBuilder sql;
Review comment:
Alternatively, you can wrap all the new groupBy changes under `if (sc !=
null) { ... }`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services