@@ -7,10 +7,12 @@ module Quoting
77 # QUOTING ==================================================
88 #
99 # see: abstract/quoting.rb
10+ QUOTED_COLUMN_NAMES = Concurrent ::Map . new # :nodoc:
11+ QUOTED_TABLE_NAMES = Concurrent ::Map . new # :nodoc:
1012
1113 def quote_column_name ( name ) # :nodoc:
1214 name = name . to_s
13- self . class . quoted_column_names [ name ] ||= if /\A [a-z][a-z_0-9$#]*\Z / . match? ( name )
15+ QUOTED_COLUMN_NAMES [ name ] ||= if /\A [a-z][a-z_0-9$#]*\Z / . match? ( name )
1416 "\" #{ name . upcase } \" "
1517 else
1618 # remove double quotes which cannot be used inside quoted identifier
@@ -26,7 +28,7 @@ def quote_column_name_or_expression(name) # :nodoc:
2628 # if only valid lowercase column characters in name
2729 when /^[a-z][a-z_0-9$#]*$/
2830 "\" #{ name . upcase } \" "
29- when /^[a-z][a-z_0-9$#\ - ]*$/i
31+ when /^[a-z][a-z_0-9$#-]*$/i
3032 "\" #{ name } \" "
3133 # if other characters present then assume that it is expression
3234 # which should not be quoted
@@ -67,7 +69,7 @@ def self.mixed_case?(name)
6769
6870 def quote_table_name ( name ) # :nodoc:
6971 name , _link = name . to_s . split ( "@" )
70- self . class . quoted_table_names [ name ] ||= [ name . split ( "." ) . map { |n | quote_column_name ( n ) } ] . join ( "." )
72+ QUOTED_TABLE_NAMES [ name ] ||= [ name . split ( "." ) . map { |n | quote_column_name ( n ) } ] . join ( "." )
7173 end
7274
7375 def quote_string ( s ) # :nodoc:
0 commit comments