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

Fix for text showplan #1174

Merged
merged 2 commits into from
May 16, 2024
Merged

Fix for text showplan #1174

merged 2 commits into from
May 16, 2024

Conversation

aidanharan
Copy link
Contributor

Fix for text showplan, which returns 2 result sets for single query. The multiple column headers were causing the following bug.

Screenshot 2024-05-15 at 17 05 15

https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/actions/runs/9085233159/job/24968052134?pr=1173

ShowplanTestSQLServer::With SHOWPLAN_TEXT option#test_0001_use simple table printer:
RuntimeError: Wrapped undumpable exception for: ActiveRecord::StatementInvalid: NoMethodError: undefined method `-@' for an instance of Array
    /usr/local/bundle/bundler/gems/rails-1d681e341c01/activerecord/lib/active_record/result.rb:52:in `each'
    /usr/local/bundle/bundler/gems/rails-1d681e341c01/activerecord/lib/active_record/result.rb:52:in `initialize'
    /activerecord-sqlserver-adapter/lib/active_record/connection_adapters/sqlserver/database_statements.rb:437:in `new'
    /activerecord-sqlserver-adapter/lib/active_record/connection_adapters/sqlserver/database_statements.rb:437:in `handle_to_names_and_values'
    /activerecord-sqlserver-adapter/lib/active_record/connection_adapters/sqlserver/database_statements.rb:61:in `internal_exec_sql_query'

@aidanharan aidanharan marked this pull request as ready for review May 16, 2024 09:36
@aidanharan aidanharan merged commit d48c790 into main May 16, 2024
2 of 8 checks passed
@aidanharan aidanharan deleted the explain-multiple-result-sets branch May 16, 2024 09:36
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