Line 24 in the rakefile that is causing the problem is
ActiveRecord::Base.connection.execute_structure_dump(ActiveRecord::Base.connection.full_drop). This appears to be related to the changes in https://github.com/rails/rails/pull/44576 and https://github.com/rails/rails/pull/44591. We no longer have a @raw_connection after calling ActiveRecord::Base.establish_connection(CONNECTION_PARAMS) on line 22, so trying work with ActiveRecord::Base.connection gives us the nil error.
3a288c3 addresses the error in starting the tests by:
change get_database_version to use valid_raw_connection which will connect if necessary
setting self.lock_thread = nil before the call to super in OracleEnhancedAdapter#initialize. In super they assign a visitor before self.lock_thread = nil. In oracle enhanced assigning a visitor requires a check of database_version, which with the new use of valid_raw_connection requires @lock to be set first.
After those changes, the test start, although with many errors. A couple of the more immediate ones are addressed here as well:
https://github.com/rails/rails/pull/48229 requires an internal_exec_query that is called by the abstract adapter's exec_query. Renaming oracle_enhanced's exec_query to internal_exec_query to address this
I saw lots of errors with active? because @raw_connection is nil. Using valid_raw_connection in active? results in a stack level too deep, so I adapted he postgres adapter's implementation.
When running the oracle enhanced tests with activerecord v7.1.0 or above I get:
Line 24 in the rakefile that is causing the problem is
ActiveRecord::Base.connection.execute_structure_dump(ActiveRecord::Base.connection.full_drop)
. This appears to be related to the changes in https://github.com/rails/rails/pull/44576 and https://github.com/rails/rails/pull/44591. We no longer have a@raw_connection
after callingActiveRecord::Base.establish_connection(CONNECTION_PARAMS)
on line 22, so trying work withActiveRecord::Base.connection
gives us the nil error.3a288c3 addresses the error in starting the tests by:
get_database_version
to usevalid_raw_connection
which will connect if necessaryself.lock_thread = nil
before the call tosuper
inOracleEnhancedAdapter#initialize
. In super they assign a visitor beforeself.lock_thread = nil
. In oracle enhanced assigning a visitor requires a check ofdatabase_version
, which with the new use ofvalid_raw_connection
requires@lock
to be set first.After those changes, the test start, although with many errors. A couple of the more immediate ones are addressed here as well:
internal_exec_query
that is called by the abstract adapter'sexec_query
. Renaming oracle_enhanced'sexec_query
tointernal_exec_query
to address thisactive?
because@raw_connection
is nil. Usingvalid_raw_connection
inactive?
results in a stack level too deep, so I adapted he postgres adapter's implementation.