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

Merge pull request #2151 from yahonda/fix2139 #2160

Merged
merged 2 commits into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
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 @@ -98,6 +98,8 @@ def new_connection(config)
@raw_connection = @raw_connection.underlying_connection
end

# Workaround FrozenError (can't modify frozen Hash):
config = config.dup
config[:driver] ||= @raw_connection.meta_data.connection.java_class.name
username = @raw_connection.meta_data.user_name
else
Expand Down
13 changes: 5 additions & 8 deletions lib/active_record/connection_adapters/oracle_enhanced/quoting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ module Quoting

def quote_column_name(name) #:nodoc:
name = name.to_s
self.class.quoted_column_names[name] ||= begin
# if only valid lowercase column characters in name
if /\A[a-z][a-z_0-9\$#]*\Z/.match?(name)
"\"#{name.upcase}\""
else
# remove double quotes which cannot be used inside quoted identifier
"\"#{name.gsub('"', '')}\""
end
self.class.quoted_column_names[name] ||= if /\A[a-z][a-z_0-9\$#]*\Z/.match?(name)
"\"#{name.upcase}\""
else
# remove double quotes which cannot be used inside quoted identifier
"\"#{name.gsub('"', '')}\""
end
end

Expand Down