aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2016-05-04 11:24:09 -0500
committerSean Griffin <sean@seantheprogrammer.com>2016-05-04 11:24:09 -0500
commitcd81da63fe2d8f2ada4becce7c582fbd9acba107 (patch)
tree3ccf4d3fdc2668b587708c26dda7390ab4bbe12d /lib
parentf2ad22320d82021277ab835d4d44bef5e8b61866 (diff)
parentf852b608d140addcbdc7ecb85d42eef0bbd512c5 (diff)
downloadrails-cd81da63fe2d8f2ada4becce7c582fbd9acba107.tar.gz
rails-cd81da63fe2d8f2ada4becce7c582fbd9acba107.tar.bz2
rails-cd81da63fe2d8f2ada4becce7c582fbd9acba107.zip
Merge pull request #430 from yahonda/oracle12_limit_and_lock_2
Raise ArgumentError if limit and lock are used for Oracle12 visitor
Diffstat (limited to 'lib')
-rw-r--r--lib/arel/visitors/oracle12.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/arel/visitors/oracle12.rb b/lib/arel/visitors/oracle12.rb
index 4a42343c9b..d21a829848 100644
--- a/lib/arel/visitors/oracle12.rb
+++ b/lib/arel/visitors/oracle12.rb
@@ -6,10 +6,12 @@ module Arel
def visit_Arel_Nodes_SelectStatement o, collector
# Oracle does not allow LIMIT clause with select for update
if o.limit && o.lock
- o = o.dup
- o.limit = []
+ raise ArgumentError, <<-MSG
+ 'Combination of limit and lock is not supported.
+ because generated SQL statements
+ `SELECT FOR UPDATE and FETCH FIRST n ROWS` generates ORA-02014.`
+ MSG
end
-
super
end