File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -1395,3 +1395,22 @@ class EnumTest < ActiveRecord::TestCase
1395
1395
Book . connection . add_index ( :books , [ :author_id , :name ] , unique : true )
1396
1396
end
1397
1397
end
1398
+
1399
+
1400
+
1401
+
1402
+ require 'models/citation'
1403
+ class EagerLoadingTooManyIdsTest < ActiveRecord ::TestCase
1404
+ # Original Rails test fails with SQL Server error message "The query processor ran out of internal resources and
1405
+ # could not produce a query plan". This error goes away if you change database compatibility level to 110 (SQL 2012).
1406
+ # However, you cannot change the compatibility level during a test. The purpose of the test is to ensure that the
1407
+ # bind params are not used if they exceed the `bind_params_length` of the adapter. The coerced test still does
1408
+ # this as there will be 32,768 remaining citation records in teh database and the `bind_params_length` of
1409
+ # adapter is 2,098.
1410
+ coerce_tests! :test_eager_loading_too_may_ids
1411
+ def test_eager_loading_too_may_ids_coerced
1412
+ Citation . limit ( 32768 ) . order ( id : :desc ) . delete_all
1413
+
1414
+ original_test_eager_loading_too_may_ids
1415
+ end
1416
+ end
You can’t perform that action at this time.
0 commit comments