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 @@ -285,7 +285,7 @@ def self.new_connection(config)
285285 privilege = config [ :privilege ] && config [ :privilege ] . to_sym
286286 async = config [ :allow_concurrency ]
287287 prefetch_rows = config [ :prefetch_rows ] || 100
288- cursor_sharing = config [ :cursor_sharing ]
288+ cursor_sharing = config [ :cursor_sharing ] || "force"
289289 # get session time_zone from configuration or from TZ environment variable
290290 time_zone = config [ :time_zone ] || ENV [ "TZ" ]
291291
Original file line number Diff line number Diff line change 3030 expect ( ActiveRecord ::Base . connection ) . to be_active
3131 end
3232
33- it "should use database default cursor_sharing parameter value exact by default" do
33+ it "should use database default cursor_sharing parameter value force by default" do
3434 # Use `SYSTEM_CONNECTION_PARAMS` to query v$parameter
3535 ActiveRecord ::Base . establish_connection ( SYSTEM_CONNECTION_PARAMS )
36- expect ( ActiveRecord ::Base . connection . select_value ( "select value from v$parameter where name = 'cursor_sharing'" ) ) . to eq ( "EXACT " )
36+ expect ( ActiveRecord ::Base . connection . select_value ( "select value from v$parameter where name = 'cursor_sharing'" ) ) . to eq ( "FORCE " )
3737 end
3838
39- it "should use modified cursor_sharing value force " do
40- ActiveRecord ::Base . establish_connection ( SYSTEM_CONNECTION_PARAMS . merge ( cursor_sharing : :force ) )
41- expect ( ActiveRecord ::Base . connection . select_value ( "select value from v$parameter where name = 'cursor_sharing'" ) ) . to eq ( "FORCE " )
39+ it "should use modified cursor_sharing value exact " do
40+ ActiveRecord ::Base . establish_connection ( SYSTEM_CONNECTION_PARAMS . merge ( cursor_sharing : :exact ) )
41+ expect ( ActiveRecord ::Base . connection . select_value ( "select value from v$parameter where name = 'cursor_sharing'" ) ) . to eq ( "EXACT " )
4242 end
4343end
4444
You can’t perform that action at this time.
0 commit comments