@@ -473,15 +473,15 @@ def test_select_avg_with_joins_and_group_by_as_virtual_attribute_with_ar_coerced
473
473
# Match SQL Server limit implementation
474
474
coerce_tests! :test_limit_is_kept
475
475
def test_limit_is_kept_coerced
476
- queries = capture_sql_ss { Account . limit ( 1 ) . count }
476
+ queries = capture_sql { Account . limit ( 1 ) . count }
477
477
assert_equal 1 , queries . length
478
478
assert_match ( /ORDER BY \[ accounts\] \. \[ id\] ASC OFFSET 0 ROWS FETCH NEXT @0 ROWS ONLY.*@0 = 1/ , queries . first )
479
479
end
480
480
481
481
# Match SQL Server limit implementation
482
482
coerce_tests! :test_limit_with_offset_is_kept
483
483
def test_limit_with_offset_is_kept_coerced
484
- queries = capture_sql_ss { Account . limit ( 1 ) . offset ( 1 ) . count }
484
+ queries = capture_sql { Account . limit ( 1 ) . offset ( 1 ) . count }
485
485
assert_equal 1 , queries . length
486
486
assert_match ( /ORDER BY \[ accounts\] \. \[ id\] ASC OFFSET @0 ROWS FETCH NEXT @1 ROWS ONLY.*@0 = 1, @1 = 1/ , queries . first )
487
487
end
@@ -1337,30 +1337,6 @@ def test_cache_does_not_wrap_results_in_arrays_coerced
1337
1337
assert_equal 2 , Task . lease_connection . select_value ( "SELECT count(*) AS count_all FROM tasks" )
1338
1338
end
1339
1339
end
1340
-
1341
- # Same as original test except that we expect one query to be performed to retrieve the table's primary key
1342
- # and we don't call `reload_type_map` because SQL Server adapter doesn't support it.
1343
- # When we generate the SQL for the `find` it includes ordering on the primary key. If we reset the column
1344
- # information then the primary key needs to be retrieved from the database again to generate the SQL causing the
1345
- # original test's `assert_no_queries` assertion to fail. Assert that the query was to get the primary key.
1346
- coerce_tests! :test_query_cached_even_when_types_are_reset
1347
- def test_query_cached_even_when_types_are_reset_coerced
1348
- Task . cache do
1349
- # Warm the cache
1350
- Task . find ( 1 )
1351
-
1352
- # Clear places where type information is cached
1353
- Task . reset_column_information
1354
- Task . initialize_find_by_cache
1355
- Task . define_attribute_methods
1356
-
1357
- assert_queries_count ( 1 , include_schema : true ) do
1358
- Task . find ( 1 )
1359
- end
1360
-
1361
- assert_includes ActiveRecord ::SQLCounter . log_all . first , "TC.CONSTRAINT_TYPE = N''PRIMARY KEY''"
1362
- end
1363
- end
1364
1340
end
1365
1341
1366
1342
require "models/post"
@@ -1648,7 +1624,7 @@ def test_releasing_named_savepoints_coerced
1648
1624
def test_nested_transactions_after_disable_lazy_transactions_coerced
1649
1625
Topic . lease_connection . disable_lazy_transactions!
1650
1626
1651
- capture_sql do
1627
+ actual_queries = capture_sql ( include_schema : true ) do
1652
1628
# RealTransaction (begin..commit)
1653
1629
Topic . transaction ( requires_new : true ) do
1654
1630
# ResetParentTransaction (no queries)
@@ -1666,8 +1642,6 @@ def test_nested_transactions_after_disable_lazy_transactions_coerced
1666
1642
end
1667
1643
end
1668
1644
1669
- actual_queries = ActiveRecord ::SQLCounter . log_all
1670
-
1671
1645
expected_queries = [
1672
1646
/BEGIN/i ,
1673
1647
/DELETE/i ,
@@ -1685,7 +1659,7 @@ def test_nested_transactions_after_disable_lazy_transactions_coerced
1685
1659
# SQL Server does not have query for release_savepoint.
1686
1660
coerce_tests! :test_nested_transactions_skip_excess_savepoints
1687
1661
def test_nested_transactions_skip_excess_savepoints_coerced
1688
- capture_sql do
1662
+ actual_queries = capture_sql ( include_schema : true ) do
1689
1663
# RealTransaction (begin..commit)
1690
1664
Topic . transaction ( requires_new : true ) do
1691
1665
# ResetParentTransaction (no queries)
@@ -1703,8 +1677,6 @@ def test_nested_transactions_skip_excess_savepoints_coerced
1703
1677
end
1704
1678
end
1705
1679
1706
- actual_queries = ActiveRecord ::SQLCounter . log_all
1707
-
1708
1680
expected_queries = [
1709
1681
/BEGIN/i ,
1710
1682
/DELETE/i ,
0 commit comments