Skip to content

Coerce relation test #1297

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

Merged
merged 1 commit into from
Feb 12, 2025
Merged

Coerce relation test #1297

merged 1 commit into from
Feb 12, 2025

Conversation

aidanharan
Copy link
Contributor

Fix ActiveRecord::RelationTest#test_0011_runs queries when using pick with aggregate expression despite empty IN. Test added by rails/rails#53775

https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/actions/runs/13261486046/job/37018909018

 2) Error:
ActiveRecord::RelationTest#test_0011_runs queries when using pick with aggregate expression despite empty IN:
ActiveRecord::StatementInvalid: TinyTds::Error: Column "posts.id" is invalid in the ORDER BY clause because it is not contained in either an aggregate function or the GROUP BY clause.
    lib/active_record/connection_adapters/sqlserver/database_statements.rb:446:in `each'
    lib/active_record/connection_adapters/sqlserver/database_statements.rb:446:in `handle_to_names_and_values'
    lib/active_record/connection_adapters/sqlserver/database_statements.rb:67:in `internal_exec_sql_query'
    lib/active_record/connection_adapters/sqlserver/database_statements.rb:25:in `perform_query'

@aidanharan aidanharan changed the title Coerce test Coerce relation test Feb 12, 2025
@aidanharan aidanharan marked this pull request as ready for review February 12, 2025 12:22
@aidanharan aidanharan merged commit 6f89d22 into main Feb 12, 2025
2 of 5 checks passed
@aidanharan aidanharan deleted the coerce-relation-test-aggregate-pick branch February 12, 2025 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant