SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,055
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)

    Submitted form data too large for database

    Hi,
    I have an online-form (made using ruby on rails) which has loads of fields.
    If a user inputs too much data then I get the error:
    ActiveRecord::StatementInvalid (Mysql::Error: Got error 139 from storage engine: ...
    It seems that the data which is being submitted is too big for the MySQL database.
    My question: What can one do here?
    Is it possible to save the data in two tables and if so, how?
    Thanks in advance.

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,260
    Mentioned
    196 Post(s)
    Tagged
    2 Thread(s)
    Maybe you can change the field's datatype. eg. bigint instead of smallint, blob instead of varchar.

  3. #3
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,055
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    Hi,
    Thanks for the answer.
    I've managed to understand / solve the problem and just wanted to post
    back here in case it helps anyone else.
    Having read this: http://bugs.mysql.com/bug.php?id=10035
    it appears that this error is caused when a MySQL table has more than 10
    columns of the type "text".
    I tested this by creating a form with 11 text fields. I filled ten of
    them with input of 15,000 chrs and submitted it - everything fine. I
    stuck 15,000 characters in the eleventh text field and sure enough the
    same error was thrown. I started deleting the characters in the eleventh
    text field and at some point I was able to successfully submit the form.
    If I understand the advice given on
    http://bugs.mysql.com/bug.php?id=10035 correctly then the solution to
    this is to save one's data in two tables, which is what I have done.

  4. #4
    SitePoint Evangelist
    Join Date
    Feb 2006
    Location
    Worcs. UK
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think your problem is related to the InnoDB storage engine rather than MySQL. The problem you are having is listed in "Restrictions on InnoDB Tables" in the MySQL documentation.

    I think the solution is in that documentation:
    Quote Originally Posted by MySQL docs
    The maximum row length, except for variable-length columns (VARBINARY, VARCHAR, BLOB and TEXT), is slightly less than half of a database page. That is, the maximum row length is about 8000 bytes. LONGBLOB and LONGTEXT columns must be less than 4GB, and the total row length, including BLOB and TEXT columns, must be less than 4GB.
    Change the field types from TEXT to either LONGTEXT or LONGBLOB. That will give you 4Gb max length.

    It would also be worth checking out the other storage engine types available in MySQL as they might better suit the data you are trying to store.

  5. #5
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,055
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    Thanks for the reply.
    I did what you suggested and altered the engine type to MyISAM.
    And guess what - the problem dissapeared! Wonderful.
    Thanks again.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •