/usr/lib/python2.5/site-packages/SQLAlchemy-0.3.11-py2.5.egg/
sqlalchemy/databases/mysql.py:1042: Warning: Data truncated for column
'payload' at row 1
cursor.execute(statement, parameters)
I don't know if it is a bug or a installation problem.
Any help?
Best regards
Alejandro
You've found a bug/limitation when using Posterity together with MySQL.
It appears that the standard MySQL BLOB data type only supports 2^16
bytes and the MySQL specific data type LONGBLOB has to be used to store
more data. The following SQL statement should make your database use the
LONGBLOB data type:
ALTER TABLE msg MODIFY COLUMN payload LONGBLOB;
I've created a new ticket to track this bug:
http://posterity.edgewall.org/ticket/36
Cheers,
Jonas
The main reason the whole message is stored in the database unparsed is
as an extra guarantee against data loss. This way a bug in the message
parser or anywhere else can never cause any data loss since we can
always re-parse the message. Another reason is to reduse code
complexity, storing mime structures efficiently in a relational database
is a complex task.
Of course this approach has a couple of drawbacks as well as you
mentioned, mainly performance. (Re)parsing messages every time they are
viewed adds some overhead, but so far this hasn't really been an issue.
Especially since the current database schema already stores a parsed
copy of relevant messages headers so things like the message list can be
rendered without needing to parse any messages.
But anyway, I don't have any problem with switching to a more normalized
database schema if the benefits are strong enough.
> Perhaps storing messages differently would it make easier to show a
> attachment icon in the message list page.
I was actually planning to add a simple "has_attachments" boolean
attribute to the message table. This would be enough to add an icon
indicating that a message has attachments. Or do you want to be able to
see the actual filenames as well?
Cheers,
Jonas