@@ -375,9 +375,6 @@ def setup
375
375
@connection = ActiveRecord ::Base . connection
376
376
end
377
377
378
- unless in_memory_db?
379
- end
380
-
381
378
def test_create_with_query_cache
382
379
@connection . enable_query_cache!
383
380
@@ -696,27 +693,29 @@ def teardown
696
693
end
697
694
end
698
695
699
- unless current_adapter? ( :SQLite3Adapter )
700
- test "#execute is retryable" do
701
- conn_id = case @connection . class ::ADAPTER_NAME
702
- when "Mysql2"
703
- @connection . execute ( "SELECT CONNECTION_ID()" ) . to_a [ 0 ] [ 0 ]
704
- when "PostgreSQL"
705
- @connection . execute ( "SELECT pg_backend_pid()" ) . to_a [ 0 ] [ "pg_backend_pid" ]
706
- end
696
+ test "#execute is retryable" do
697
+ conn_id = case @connection . class ::ADAPTER_NAME
698
+ when "Mysql2"
699
+ @connection . execute ( "SELECT CONNECTION_ID()" ) . to_a [ 0 ] [ 0 ]
700
+ when "Trilogy"
701
+ @connection . execute ( "SELECT CONNECTION_ID() as connection_id" ) . to_a [ 0 ] [ 0 ]
702
+ when "PostgreSQL"
703
+ @connection . execute ( "SELECT pg_backend_pid()" ) . to_a [ 0 ] [ "pg_backend_pid" ]
704
+ else
705
+ skip ( "kill_connection_from_server unsupported" )
706
+ end
707
707
708
- kill_connection_from_server ( conn_id )
708
+ kill_connection_from_server ( conn_id )
709
709
710
- @connection . execute ( "SELECT 1" , allow_retry : true )
711
- end
710
+ @connection . execute ( "SELECT 1" , allow_retry : true )
712
711
end
713
712
714
713
private
715
714
def raw_transaction_open? ( connection )
716
715
case connection . class ::ADAPTER_NAME
717
716
when "PostgreSQL"
718
717
connection . instance_variable_get ( :@raw_connection ) . transaction_status == ::PG ::PQTRANS_INTRANS
719
- when "Mysql2"
718
+ when "Mysql2" , "Trilogy"
720
719
begin
721
720
connection . instance_variable_get ( :@raw_connection ) . query ( "SAVEPOINT transaction_test" )
722
721
connection . instance_variable_get ( :@raw_connection ) . query ( "RELEASE SAVEPOINT transaction_test" )
@@ -733,7 +732,7 @@ def raw_transaction_open?(connection)
733
732
true
734
733
end
735
734
else
736
- skip
735
+ skip ( "kill_connection_from_server unsupported" )
737
736
end
738
737
end
739
738
@@ -745,21 +744,23 @@ def remote_disconnect(connection)
745
744
end
746
745
connection . instance_variable_get ( :@raw_connection ) . async_exec ( "set idle_in_transaction_session_timeout = '10ms'" )
747
746
sleep 0.05
748
- when "Mysql2"
747
+ when "Mysql2" , "Trilogy"
749
748
connection . send ( :internal_execute , "set @@wait_timeout=1" )
750
749
sleep 1.2
751
750
else
752
- skip
751
+ skip ( "remote_disconnect unsupported" )
753
752
end
754
753
end
755
754
756
755
def kill_connection_from_server ( connection_id )
757
756
conn = @connection . pool . checkout
758
757
case conn . class ::ADAPTER_NAME
759
- when "Mysql2"
758
+ when "Mysql2" , "Trilogy"
760
759
conn . execute ( "KILL #{ connection_id } " )
761
760
when "PostgreSQL"
762
761
conn . execute ( "SELECT pg_cancel_backend(#{ connection_id } )" )
762
+ else
763
+ skip ( "kill_connection_from_server unsupported" )
763
764
end
764
765
765
766
conn . close
0 commit comments