@@ -36,7 +36,7 @@ def table_exists?(table_name)
36
36
else
37
37
default_owner = current_schema
38
38
end
39
- real_name = OracleEnhanced ::Quoting . valid_table_name? ( table_name ) ?
39
+ real_name = OracleEnhanced ::Quoting . valid_table_name? ( table_name , supports_longer_identifier? ) ?
40
40
table_name . upcase : table_name
41
41
if real_name . include? ( "." )
42
42
table_owner , table_name = real_name . split ( "." )
@@ -53,7 +53,7 @@ def table_exists?(table_name)
53
53
end
54
54
55
55
def data_source_exists? ( table_name )
56
- ( _owner , _table_name ) = @connection . describe ( table_name )
56
+ ( _owner , _table_name ) = @connection . describe ( table_name , supports_longer_identifier? )
57
57
true
58
58
rescue
59
59
false
@@ -87,7 +87,7 @@ def synonyms
87
87
end
88
88
89
89
def indexes ( table_name ) #:nodoc:
90
- ( _owner , table_name ) = @connection . describe ( table_name )
90
+ ( _owner , table_name ) = @connection . describe ( table_name , supports_longer_identifier? )
91
91
default_tablespace_name = default_tablespace
92
92
93
93
result = select_all ( <<~SQL . squish , "SCHEMA" , [ bind_string ( "table_name" , table_name ) ] )
@@ -253,8 +253,8 @@ def primary_key(*args)
253
253
end
254
254
255
255
def rename_table ( table_name , new_name ) #:nodoc:
256
- if new_name . to_s . length > DatabaseLimits :: IDENTIFIER_MAX_LENGTH
257
- raise ArgumentError , "New table name '#{ new_name } ' is too long; the limit is #{ DatabaseLimits :: IDENTIFIER_MAX_LENGTH } characters"
256
+ if new_name . to_s . length > max_identifier_length
257
+ raise ArgumentError , "New table name '#{ new_name } ' is too long; the limit is #{ max_identifier_length } characters"
258
258
end
259
259
schema_cache . clear_data_source_cache! ( table_name . to_s )
260
260
schema_cache . clear_data_source_cache! ( new_name . to_s )
@@ -366,7 +366,7 @@ def index_name(table_name, options) #:nodoc:
366
366
#
367
367
# Will always query database and not index cache.
368
368
def index_name_exists? ( table_name , index_name )
369
- ( _owner , table_name ) = @connection . describe ( table_name )
369
+ ( _owner , table_name ) = @connection . describe ( table_name , supports_longer_identifier? )
370
370
result = select_value ( <<~SQL . squish , "SCHEMA" , [ bind_string ( "table_name" , table_name ) , bind_string ( "index_name" , index_name . to_s . upcase ) ] )
371
371
SELECT /*+ OPTIMIZER_FEATURES_ENABLE('11.2.0.2') */ 1 FROM all_indexes i
372
372
WHERE i.owner = SYS_CONTEXT('userenv', 'current_schema')
@@ -501,7 +501,7 @@ def change_column_comment(table_name, column_name, comment_or_changes)
501
501
502
502
def table_comment ( table_name ) #:nodoc:
503
503
# TODO
504
- ( _owner , table_name ) = @connection . describe ( table_name )
504
+ ( _owner , table_name ) = @connection . describe ( table_name , supports_longer_identifier? )
505
505
select_value ( <<~SQL . squish , "SCHEMA" , [ bind_string ( "table_name" , table_name ) ] )
506
506
SELECT /*+ OPTIMIZER_FEATURES_ENABLE('11.2.0.2') */ comments FROM all_tab_comments
507
507
WHERE owner = SYS_CONTEXT('userenv', 'current_schema')
@@ -517,7 +517,7 @@ def table_options(table_name) # :nodoc:
517
517
518
518
def column_comment ( table_name , column_name ) #:nodoc:
519
519
# TODO: it does not exist in Abstract adapter
520
- ( _owner , table_name ) = @connection . describe ( table_name )
520
+ ( _owner , table_name ) = @connection . describe ( table_name , supports_longer_identifier? )
521
521
select_value ( <<~SQL . squish , "SCHEMA" , [ bind_string ( "table_name" , table_name ) , bind_string ( "column_name" , column_name . upcase ) ] )
522
522
SELECT /*+ OPTIMIZER_FEATURES_ENABLE('11.2.0.2') */ comments FROM all_col_comments
523
523
WHERE owner = SYS_CONTEXT('userenv', 'current_schema')
@@ -545,7 +545,7 @@ def tablespace(table_name)
545
545
546
546
# get table foreign keys for schema dump
547
547
def foreign_keys ( table_name ) #:nodoc:
548
- ( _owner , desc_table_name ) = @connection . describe ( table_name )
548
+ ( _owner , desc_table_name ) = @connection . describe ( table_name , supports_longer_identifier? )
549
549
550
550
fk_info = select_all ( <<~SQL . squish , "SCHEMA" , [ bind_string ( "desc_table_name" , desc_table_name ) ] )
551
551
SELECT /*+ OPTIMIZER_FEATURES_ENABLE('11.2.0.2') */ r.table_name to_table
0 commit comments