mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
31ffbf8d50
Currently several queries cannot return correct result due to incorrect `RangeError` handling. First example: ```ruby assert_equal true, Topic.where(id: [1, 9223372036854775808]).exists? assert_equal true, Topic.where.not(id: 9223372036854775808).exists? ``` The first example is obviously to be true, but currently it returns false. Second example: ```ruby assert_equal topics(:first), Topic.where(id: 1..9223372036854775808).find(1) ``` The second example also should return the object, but currently it raises `RecordNotFound`. It can be seen from the examples, the queries including large number assuming empty result is not always correct. Therefore, This change handles `RangeError` to generate executable SQL instead of raising `RangeError` to users to always return correct result. By this change, it is no longer raised `RangeError` to users. |
||
---|---|---|
.. | ||
delegation_test.rb | ||
delete_all_test.rb | ||
merging_test.rb | ||
mutation_test.rb | ||
or_test.rb | ||
predicate_builder_test.rb | ||
record_fetch_warning_test.rb | ||
select_test.rb | ||
update_all_test.rb | ||
where_chain_test.rb | ||
where_clause_test.rb | ||
where_test.rb |