1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib/arel
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
..
attributes Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
collectors SQLString#compile is no longer used since 53521a9e39 2018-09-30 16:49:13 +09:00
nodes Use unboundable? rather than boundable? 2019-01-18 14:56:43 +09:00
visitors All of queries should return correct result even if including large number 2019-01-18 16:01:07 +09:00
alias_predication.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
attributes.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
crud.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
delete_manager.rb Handle DELETE with LIMIT in Arel 2018-09-30 21:21:54 +09:00
errors.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
expressions.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
factory_methods.rb Make update_counters preparable 2018-09-28 04:14:15 +09:00
insert_manager.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
math.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
nodes.rb
order_predications.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
predications.rb All of queries should return correct result even if including large number 2019-01-18 16:01:07 +09:00
select_manager.rb Abandon TOP support. 2018-09-25 15:39:14 +04:00
table.rb Use private attr_reader in Arel 2018-09-30 15:24:17 +09:00
tree_manager.rb Handle UPDATE/DELETE with OFFSET in Arel 2018-10-01 11:53:15 +09:00
update_manager.rb Handle DELETE with LIMIT in Arel 2018-09-30 21:21:54 +09:00
visitors.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30
window_predications.rb Arel: :nodoc: all 2018-02-24 18:11:47 +10:30