1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/cases/relation
Ryuta Kamizono 31ffbf8d50 All of queries should return correct result even if including large number
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.
2019-01-18 16:01:07 +09:00
..
delegation_test.rb Remove delegation of missing methods in a relation to arel 2019-01-17 16:08:32 -05:00
delete_all_test.rb Extract {update,delete}_all_test.rb from persistence_test.rb and relations_test.rb 2018-09-16 08:41:08 +09:00
merging_test.rb Bugfix ActiveRecord::Relation#merge special case of from clause 2018-09-28 11:46:40 +03:00
mutation_test.rb don't check for immutability when setting skip_preloading as it doesn't effect the arel and the arel may already be generated by fresh_when 2018-04-12 10:17:31 +10:00
or_test.rb All of queries should return correct result even if including large number 2019-01-18 16:01:07 +09:00
predicate_builder_test.rb
record_fetch_warning_test.rb
select_test.rb Fix the obvious typos detected by github.com/client9/misspell 2018-08-08 21:55:46 +09:00
update_all_test.rb Enable Style/RedundantBegin cop to avoid newly adding redundant begin block 2018-12-21 06:12:42 +09:00
where_chain_test.rb
where_clause_test.rb Arel: Implemented DB-aware NULL-safe comparison (#34451) 2018-11-15 14:49:55 -05:00
where_test.rb All of queries should return correct result even if including large number 2019-01-18 16:01:07 +09:00