-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
count(distinct col) renturn null #4680
Comments
I will try to reproduce this issue later, maybe tomorrow. |
I reproduced it. It's a bug. |
AggregationType(MAX, MIN, SUM, COUNT, AVG) + Distinct all have this problem. |
I will fix to show:
|
+1 |
Hi this issue has been fixed already. If it is convenient, you can give it a test on the master branch. Thx. |
I'm using version 4.0.0-RC3. Which version should I upgrade to |
* fix: SQL COUNT with GROUP BY to prevent incorrect row returns * test: Add test cases for empty result with GROUP BY and ORDER BY * fix: update db types and scenario type for e2e test case * fix: update column names for e2e test * fix: fix unit tests for empty result set * test: add e2e tests for issue #4680 * fix: fix e2e tests for issue #4680 * update e2e tests for isssue #4680 * fix: fix failing checks * fix: update conditions for group by and aggregate functions
mybatis:int getMsgDay(@param("account_uid") String account_uid);
SQL:SELECT COUNT(DISTINCT DATE_FORMAT(create_time,'%Y%m%d')) as count FROM table_name
WHERE account_uid = #{account_uid}
if there is no data, then return null, not return 0, it case an exection:
org.apache.ibatis.binding.BindingException: Mapper method 'com.*.getMsgDay attempted to return null from a method with a primitive return type (int).
The text was updated successfully, but these errors were encountered: