aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/visitors/mysql.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-10-20 17:16:18 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-10-20 17:16:18 -0700
commite42506f9ea58511246f638e81002947ee3c36b18 (patch)
tree5f7b88a09b345c124fffefa733d8c49343552cc6 /lib/arel/visitors/mysql.rb
parent4041d7d33ad3f0acb0b04ed51da3ae29123250cb (diff)
downloadrails-e42506f9ea58511246f638e81002947ee3c36b18.tar.gz
rails-e42506f9ea58511246f638e81002947ee3c36b18.tar.bz2
rails-e42506f9ea58511246f638e81002947ee3c36b18.zip
adding default limits when there is an offset for sqlite and mysql [#5316 state:resolved]
Diffstat (limited to 'lib/arel/visitors/mysql.rb')
-rw-r--r--lib/arel/visitors/mysql.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/arel/visitors/mysql.rb b/lib/arel/visitors/mysql.rb
index 0c94ee1b27..594fd5504a 100644
--- a/lib/arel/visitors/mysql.rb
+++ b/lib/arel/visitors/mysql.rb
@@ -2,6 +2,13 @@ module Arel
module Visitors
class MySQL < Arel::Visitors::ToSql
private
+ ###
+ # :'(
+ # http://dev.mysql.com/doc/refman/5.0/en/select.html#id3482214
+ def visit_Arel_Nodes_SelectStatement o
+ o.limit = 18446744073709551615 if o.offset && !o.limit
+ super
+ end
def visit_Arel_Nodes_UpdateStatement o
[