mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Support locking in Oracle
This commit is contained in:
parent
83a5d4d4e3
commit
bca49f4e5b
2 changed files with 11 additions and 0 deletions
|
@ -3,6 +3,10 @@ module Arel
|
|||
class Oracle < Arel::Visitors::ToSql
|
||||
private
|
||||
|
||||
def visit_Arel_Nodes_Lock o
|
||||
visit o.expr
|
||||
end
|
||||
|
||||
def visit_Arel_Nodes_SelectStatement o
|
||||
o = order_hacks(o)
|
||||
|
||||
|
|
|
@ -143,6 +143,13 @@ module Arel
|
|||
( SELECT * FROM users WHERE age > 10 MINUS SELECT * FROM users WHERE age > 20 )
|
||||
}
|
||||
end
|
||||
|
||||
describe 'locking' do
|
||||
it 'defaults to FOR UPDATE when locking' do
|
||||
node = Nodes::Lock.new(Arel.sql('FOR UPDATE'))
|
||||
@visitor.accept(node).must_be_like "FOR UPDATE"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue