diff options
Diffstat (limited to 'lib/arel/visitors')
-rw-r--r-- | lib/arel/visitors/mysql.rb | 7 | ||||
-rw-r--r-- | lib/arel/visitors/sqlite.rb | 11 |
2 files changed, 18 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 [ diff --git a/lib/arel/visitors/sqlite.rb b/lib/arel/visitors/sqlite.rb new file mode 100644 index 0000000000..c45160851d --- /dev/null +++ b/lib/arel/visitors/sqlite.rb @@ -0,0 +1,11 @@ +module Arel + module Visitors + class SQLite < Arel::Visitors::ToSql + private + def visit_Arel_Nodes_SelectStatement o + o.limit = -1 if o.offset && !o.limit + super + end + end + end +end |