ActiveRecord::StatementInvalid

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

I 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

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

Quoting Tom Mac <lists@ruby-forum.com>:

> 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

Thanks for your reply. Meanwhile I have done it.