Skip to content
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

[DAP231] False positive: Full table aggregation #81

Closed
dotTrench opened this issue Nov 16, 2023 · 2 comments · Fixed by #82
Closed

[DAP231] False positive: Full table aggregation #81

dotTrench opened this issue Nov 16, 2023 · 2 comments · Fixed by #82

Comments

@dotTrench
Copy link

Describe the bug

When using an aggregation function e.g. MIN/MAX an a full table a false DAP231 warning is given

Dapper.Advisor: 1.0.10

To Reproduce

// DAP231: SELECT for single row without WHERE or (TOP and ORDER BY)
public static async Task<int> SelectMax(SqlConnection connection) =>
    await connection.QueryFirstOrDefaultAsync<int>("SELECT MAX(SomeColumn) FROM MyTable");
@mgravell
Copy link
Member

D'oh, I should have thought of that. Thanks, great example.

mgravell added a commit that referenced this issue Nov 17, 2023
* fix #79

* fix #80; add new rule 243 for invalid datepart expressions

* groundwork for aggregate

* fix #81; add new rule DAP244 for mixing aggregate and non-aggregate data
@mgravell
Copy link
Member

https://github.com/DapperLib/DapperAOT/releases/tag/1.0.16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants