-1

When I insert a very long text in a long text field, Drupal shows this error:

Data too long

This field is allocated for articles in a content type, so I am sure the data will not be longer than some extent, but when the number of characters is almost more than 30000, it shows the error. Is there any default limitation on it?

The exception I get is the following one:

PDOException: SQLSTATE[HY000]: General error: 1406 Data too long for column 'source' at row 1: INSERT INTO {locales_source} (location, version, source, context, textgroup) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4);

0

1 Answer 1

4

Maximum theoretical data length in this database column is 4'294'967'299 characters (less than 232)

It is also limited by:

The maximum size of a BLOB or TEXT object is determined by its type, but the largest value you actually can transmit between the client and server is determined by the amount of available memory and the size of the communications buffers.

"Data too long" is a MySQL error message, not Drupal one, so you need to re-configure your MySQL if you want to allow longer texts in body (or any other field)., as described in MySQL documentation.

4
  • Yes you are right, this is an error from MySQL not drupal. I updated the question, does it give you any clue ?
    – M a m a D
    Commented Oct 21, 2013 at 9:52
  • @Mohammad it only confirms my answer is valid. You need to re-configure your MySQL sever. Questions about server configuration are best to ask at Server Fault, but be sure to read MySQL docs I linked in my answer first, and try configuration options pointed in them.
    – Mołot
    Commented Oct 21, 2013 at 9:55
  • then what exactly do I need to configure?
    – M a m a D
    Commented Oct 21, 2013 at 10:53
  • 1
    @Mohammad read the docs I linked, please. Search for the quote I pasted, and read on. Then, if you can't do it, go to dba.stackexchange.com or servefault.com
    – Mołot
    Commented Oct 21, 2013 at 11:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.