aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/arel/visitors/oracle12.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/arel/visitors/oracle12.rb')
-rw-r--r--activerecord/lib/arel/visitors/oracle12.rb57
1 files changed, 4 insertions, 53 deletions
diff --git a/activerecord/lib/arel/visitors/oracle12.rb b/activerecord/lib/arel/visitors/oracle12.rb
index 8e0f07fca9..6269bc3907 100644
--- a/activerecord/lib/arel/visitors/oracle12.rb
+++ b/activerecord/lib/arel/visitors/oracle12.rb
@@ -8,11 +8,10 @@ module Arel # :nodoc: all
def visit_Arel_Nodes_SelectStatement(o, collector)
# Oracle does not allow LIMIT clause with select for update
if o.limit && o.lock
- 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
+ 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
@@ -41,50 +40,6 @@ module Arel # :nodoc: all
collector << " )"
end
- def visit_Arel_Nodes_In(o, collector)
- if Array === o.right && !o.right.empty?
- o.right.delete_if { |value| unboundable?(value) }
- end
-
- if Array === o.right && o.right.empty?
- collector << "1=0"
- else
- first = true
- o.right.each_slice(in_clause_length) do |sliced_o_right|
- collector << " OR " unless first
- first = false
-
- collector = visit o.left, collector
- collector << " IN ("
- visit(sliced_o_right, collector)
- collector << ")"
- end
- end
- collector
- end
-
- def visit_Arel_Nodes_NotIn(o, collector)
- if Array === o.right && !o.right.empty?
- o.right.delete_if { |value| unboundable?(value) }
- end
-
- if Array === o.right && o.right.empty?
- collector << "1=1"
- else
- first = true
- o.right.each_slice(in_clause_length) do |sliced_o_right|
- collector << " AND " unless first
- first = false
-
- collector = visit o.left, collector
- collector << " NOT IN ("
- visit(sliced_o_right, collector)
- collector << ")"
- end
- end
- collector
- end
-
def visit_Arel_Nodes_UpdateStatement(o, collector)
# Oracle does not allow ORDER BY/LIMIT in UPDATEs.
if o.orders.any? && o.limit.nil?
@@ -106,10 +61,6 @@ module Arel # :nodoc: all
collector = visit [o.left, o.right, 0, 1], collector
collector << ")"
end
-
- def in_clause_length
- 1000
- end
end
end
end