Skip to content

Fix for text showplan #1174

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 2 commits into from
May 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,11 @@ def handle_to_names_and_values(handle, options = {})
qo[:as] = (options[:ar_result] || options[:fetch] == :rows) ? :array : :hash
end
results = handle.each(query_options)
columns = lowercase_schema_reflection ? handle.fields.map { |c| c.downcase } : handle.fields

columns = handle.fields
# If query returns multiple result sets, only return the columns of the last one.
columns = columns.last if columns.any? && columns.all? { |e| e.is_a?(Array) }
columns = columns.map(&:downcase) if lowercase_schema_reflection

options[:ar_result] ? ActiveRecord::Result.new(columns, results) : results
end
Expand Down
Loading