Hi I am using rails2.2.2 with mysql5.1. I have a text field ''EmailBody''. And when I try to store data more than 65536 (Say for example 65550) in linux it works properly by truncating it to 65536 characters and save successfully to table. But when I test this same application on a windows machine I get the error ActiveRecord::StatementInvalid. I am attaching the error I am getting on a windows machine. Is it a adapter prblem. Please help Thanks in advance Attachments: http://www.ruby-forum.com/attachment/5733/inbox.htm -- 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.
On 13 January 2011 06:44, Tom Mac <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi > I am using rails2.2.2 with mysql5.1. I have a text field ''EmailBody''. > And when I try to store data more than 65536 (Say for example 65550) in > linux it works properly by truncating it to 65536 characters and save > successfully to table. But when I test this same application on a > windows machine I get the error ActiveRecord::StatementInvalid. I am > attaching the error I am getting on a windows machine. Is it a adapter > prblem. Please helpI don''t know the cause of the problem (possibly a bug or inconsistency in the adaptor as you suggest), but in terms of getting your application running can you not just truncate the string to a valid length before saving the record? Colin -- 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.
> but in terms of getting your > application running can you not just truncate the string to a valid > length before saving the record?Yes that is possible any way not the best. Relating to this two questions. 1) Is there any other gem than mysql. I found ruby-mysql but could not try since it requires ruby >= 1.8.7 . Mine is 1.8.6 2) In mysql what is the next option than a text field that handles very large data Thanks -- 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 Tom Mac <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>:> > but in terms of getting your > > application running can you not just truncate the string to a valid > > length before saving the record? > > Yes that is possible any way not the best. Relating to this two > questions. > 1) Is there any other gem than mysql. I found ruby-mysql but could not > try since it requires ruby >= 1.8.7 . Mine is 1.8.6 > 2) In mysql what is the next option than a text field that handles very > large data >t.text "description", :limit => 16777215 This in MySQL creates a MEDIUMTEXT field with a 24-bit length. There is also a LONGTEXT type with 32-bit lengths. The default is 16-bit lengths. HTH, 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.
Thanks for your reply. Meanwhile I have done it. -- 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.