File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
lib/active_record/connection_adapters/oracle_enhanced
spec/active_record/connection_adapters/oracle_enhanced Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ def new_connection(config)
150150 # @raw_connection.setDefaultRowPrefetch(prefetch_rows) if prefetch_rows
151151 end
152152
153- cursor_sharing = config [ :cursor_sharing ]
153+ cursor_sharing = config [ :cursor_sharing ] || "force"
154154 exec "alter session set cursor_sharing = #{ cursor_sharing } " if cursor_sharing
155155
156156 # Initialize NLS parameters
Original file line number Diff line number Diff line change @@ -295,7 +295,7 @@ def self.new_connection(config)
295295 privilege = config [ :privilege ] && config [ :privilege ] . to_sym
296296 async = config [ :allow_concurrency ]
297297 prefetch_rows = config [ :prefetch_rows ] || 100
298- cursor_sharing = config [ :cursor_sharing ]
298+ cursor_sharing = config [ :cursor_sharing ] || "force"
299299 # get session time_zone from configuration or from TZ environment variable
300300 time_zone = config [ :time_zone ] || ENV [ "TZ" ]
301301
Original file line number Diff line number Diff line change 3131 expect ( ActiveRecord ::Base . connection ) . to be_active
3232 end
3333
34- it "should use database default cursor_sharing parameter value exact by default" do
34+ it "should use database default cursor_sharing parameter value force by default" do
3535 # Use `SYSTEM_CONNECTION_PARAMS` to query v$parameter
3636 ActiveRecord ::Base . establish_connection ( SYSTEM_CONNECTION_PARAMS )
37- expect ( ActiveRecord ::Base . connection . select_value ( "select value from v$parameter where name = 'cursor_sharing'" ) ) . to eq ( "EXACT " )
37+ expect ( ActiveRecord ::Base . connection . select_value ( "select value from v$parameter where name = 'cursor_sharing'" ) ) . to eq ( "FORCE " )
3838 end
3939
40- it "should use modified cursor_sharing value force " do
41- ActiveRecord ::Base . establish_connection ( SYSTEM_CONNECTION_PARAMS . merge ( cursor_sharing : :force ) )
42- expect ( ActiveRecord ::Base . connection . select_value ( "select value from v$parameter where name = 'cursor_sharing'" ) ) . to eq ( "FORCE " )
40+ it "should use modified cursor_sharing value exact " do
41+ ActiveRecord ::Base . establish_connection ( SYSTEM_CONNECTION_PARAMS . merge ( cursor_sharing : :exact ) )
42+ expect ( ActiveRecord ::Base . connection . select_value ( "select value from v$parameter where name = 'cursor_sharing'" ) ) . to eq ( "EXACT " )
4343 end
4444end
4545
You can’t perform that action at this time.
0 commit comments