diff options
author | Yasuo Honda <yasuo.honda@gmail.com> | 2019-03-03 05:32:53 +0000 |
---|---|---|
committer | Yasuo Honda <yasuo.honda@gmail.com> | 2019-03-03 05:38:09 +0000 |
commit | 417c251928fcc9bdf1dcb54dd4a75fead7c9a088 (patch) | |
tree | f7c9bfae35a45f3800d2eb23ecef3216ee70e9d9 /yarn.lock | |
parent | dfa439eefc7bfaa2f00bc8d2bd712d115dd0ef33 (diff) | |
download | rails-417c251928fcc9bdf1dcb54dd4a75fead7c9a088.tar.gz rails-417c251928fcc9bdf1dcb54dd4a75fead7c9a088.tar.bz2 rails-417c251928fcc9bdf1dcb54dd4a75fead7c9a088.zip |
Oracle database can run `delete` statement with `order by` and`fetch first n rows only`
Since https://github.com/rails/arel/pull/337 Oracle adapter uses better
top N query using `fetch first n rows only`, which can remove this
unless condition.
* This commit passes with Oracle database
```ruby
$ ARCONN=oracle bin/test test/cases/relation/delete_all_test.rb -n test_delete_all_with_order_and_limit_deletes_subset_only
Using oracle
Run options: -n test_delete_all_with_order_and_limit_deletes_subset_only --seed 1081
.
Finished in 8.068626s, 0.1239 runs/s, 0.6197 assertions/s.
1 runs, 5 assertions, 0 failures, 0 errors, 0 skips
$
```
* SQL statement includes `ORDER BY` and `FETCH FIRST n ROWS ONLY`
```sql
Post Destroy (12.5ms) DELETE FROM "POSTS" WHERE "POSTS"."ID" IN (SELECT "POSTS"."ID" FROM "POSTS" WHERE "POSTS"."AUTHOR_ID" = :a1 ORDER BY "POSTS"."ID" ASC FETCH FIRST :a2 ROWS ONLY) [["author_id", 1], ["LIMIT", 1]]
```
Diffstat (limited to 'yarn.lock')
0 files changed, 0 insertions, 0 deletions