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

SQL Analyser failure for order by count #138

Open
TSlivede opened this issue Nov 21, 2024 · 0 comments
Open

SQL Analyser failure for order by count #138

TSlivede opened this issue Nov 21, 2024 · 0 comments

Comments

@TSlivede
Copy link

Describe the bug

I get DAP200 - "SQL error: Object reference not set to an instance of an object." for the following Query below.

Where are you seeing this?

  • what Dapper/Dapper.StrongName version?
    <PackageReference Include="Dapper" Version="2.1.35" />
  • what Dapper.AOT/Dapper.Advisor version?
    <PackageReference Include="Dapper.AOT" Version="1.0.31" />
  • if relevant: what database backend?
    Microsoft Sql Server, <PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.2" />

To Reproduce

        public async Task<object> MyMethod(SqlConnection connection)
        {
            return await connection.QueryFirst(@"
                    select top 1
                        t1.val
                    from Tbl1 t1
                    join Tbl2 t2 on t1.Id = t2.Id
                    group by t1.col
                    order by count(*) desc");
        }

Expected behavior
No Error from the analyser

Additional context
As the explanation page says "I’d love to hear about it", I added this issue.

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

No branches or pull requests

1 participant