Are you storing session information in the database? If so, one of the columns (the data column IIRC) may not be large enough. This happens with postgres.
Cheers--
Charles
···
On Dec 9, 2009, at 12:50 PM, rabarama wrote:
Pleas i need help:
I'm deploying a ror application in a win server (apache + mongrel + mysql).
A model has a binary field.
win2003 server
mysql 5.0.45 community ed
ruby 1.8.6
When i upload a file (very small) i obtain the "Data Too Long for column" error.
The same code works perfectly with SQLite.
Where's the problem?
--
Charles Johnson
Advanced Computing Center for Research and Education
Vanderbilt University
Are you storing session information in the database? If so, one of the
columns (the data column IIRC) may not be large enough. This happens
with postgres.
Cheers--
no, session is at the moment in cookies.
Searching seems that the problem is db encoding, but I'm not sure how to get everything working.
This only happends when i try to store to the db a file in a binary (blob in mysql) field.
It works well if i don't upload anything.
In SQLite I don't have this problem (same code and environment, same test).
El Miércoles, 9 de Diciembre de 2009, Hassan Schroeder escribió:
On Wed, Dec 9, 2009 at 12:45 PM, rabarama > > <proftoglimipeloso@levamiyahoo.it> wrote:
>> So how big *exactly* is "very small" and what is the column definition?
>
> "very small" is a 80Kb file, and the column is a "binary" field in the
> schema that becames a BLOG column in mysql.
Last time I looked a MySQL BLOB field was 64k. Hmm. 80k, 64k --
you might want to take a look at that discrepancy
I think its more accurate to say mixing meta and binary data in the same
MySQL table is not a good idea.
Storing binary data in a separate table (and even database) from meta
data minimizes the binary data's performance impact and allows one to
use MySQL to manage referential integrity across the meta and binary
data.
I think its more accurate to say mixing meta and binary data in the same
MySQL table is not a good idea.
Storing binary data in a separate table (and even database) from meta
data minimizes the binary data's performance impact and allows one to
use MySQL to manage referential integrity across the meta and binary
data.
As far as I can see, the only advantage of storing binarie in RB tables
is to be able to store them with their metadata. If you split them into
their own table, then you're just reinventing a filesystem on top of the
existing filesystem.
In other words, if you use binary fields, you will either have
performance problems or an abstraction inversion. Just don't.