Am I correct in assuming that the max length of a string is 65,535 on a 32 bit platform? Anyway around this, other classes, 64 bit platform? TIA, Jeffrey -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Jeffrey L. Taylor wrote:> Am I correct in assuming that the max length of a string is 65,535 on a > 32 bit > platform? Anyway around this, other classes, 64 bit platform? > > TIA, > JeffreyWhat would make you assume this? Simplest demonstration: irb(main):004:0> s = "a"*70000;nil => nil irb(main):005:0> s.size => 70000 irb(main):006:0> Also, keep in mind Ruby has no separate representation for raw 8bit data. Only Strings. How would it be able to store a 65KB+ file in memory? The only limit to Ruby string is is available memory. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Paul Harrington wrote:> Jeffrey L. Taylor wrote: >> Am I correct in assuming that the max length of a string is 65,535 on a >> 32 bit >> platform? Anyway around this, other classes, 64 bit platform? >> >> TIA, >> Jeffrey > > What would make you assume this? Simplest demonstration: > > irb(main):004:0> s = "a"*70000;nil > => nil > irb(main):005:0> s.size > => 70000 > irb(main):006:0> > > Also, keep in mind Ruby has no separate representation for raw 8bit > data. Only Strings. How would it be able to store a 65KB+ file in > memory? > > The only limit to Ruby string is is available memory.btw that irb session was irb(main):001:0> RUBY_VERSION => "1.9.1" irb(main):002:0> RUBY_PLATFORM => "i386-mingw32" -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Quoting Paul Harrington <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>:> Paul Harrington wrote: > > Jeffrey L. Taylor wrote: > >> Am I correct in assuming that the max length of a string is 65,535 on a > >> 32 bit > >> platform? Anyway around this, other classes, 64 bit platform? > >> > >> TIA, > >> Jeffrey > > > > What would make you assume this? Simplest demonstration: > > > > irb(main):004:0> s = "a"*70000;nil > > => nil > > irb(main):005:0> s.size > > => 70000 > > irb(main):006:0> > > > > Also, keep in mind Ruby has no separate representation for raw 8bit > > data. Only Strings. How would it be able to store a 65KB+ file in > > memory? > > > > The only limit to Ruby string is is available memory. > > btw that irb session was > irb(main):001:0> RUBY_VERSION > => "1.9.1" > irb(main):002:0> RUBY_PLATFORM > => "i386-mingw32"I find the same results. Checking further, I find that it''s MySQL TEXT column that is limited to 65,535 bytes. Thank you, Jeffrey irb(main):001:0> s = "a"*70000;nil => nil irb(main):002:0> s.size => 70000 irb(main):003:0> RUBY_VERSION => "1.8.7" irb(main):004:0> RUBY_PLATFORM => "i586-linux" irb(main):005:0> -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Aug 19, 3:14 am, "Jeffrey L. Taylor" <r...-f/t7CGFWhwGcvWdFBKKxig@public.gmane.org> wrote:> Quoting Paul Harrington <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>: > > > > > > > Paul Harrington wrote: > > > Jeffrey L. Taylor wrote: > > >> Am I correct in assuming that the max length of a string is 65,535 on a > > >> 32 bit > > >> platform? Anyway around this, other classes, 64 bit platform? > > > >> TIA, > > >> Jeffrey > > > > What would make you assume this? Simplest demonstration: > > > > irb(main):004:0> s = "a"*70000;nil > > > => nil > > > irb(main):005:0> s.size > > > => 70000 > > > irb(main):006:0> > > > > Also, keep in mind Ruby has no separate representation for raw 8bit > > > data. Only Strings. How would it be able to store a 65KB+ file in > > > memory? > > > > The only limit to Ruby string is is available memory. > > > btw that irb session was > > irb(main):001:0> RUBY_VERSION > > => "1.9.1" > > irb(main):002:0> RUBY_PLATFORM > > => "i386-mingw32" > > I find the same results. Checking further, I find that it''s MySQL TEXT column > that is limited to 65,535 bytes. >Indeed. However, if you specify a :limit value higher than 65535 in the migration that creates the text column Rails will promote it to a ''mediumtext'', which has a limit of (I think) 16M. Pushing the limit past *that* will again promote the column to ''longtext'', which has a limit >2G. --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.