Zend_Db_Table插入大内容的问题

I've been using Zend Framework for quite a while now, but now I have an issue that's got me puzzled. I have a table (MySQL) with just 2 columns (id and msg). The id field is an auto increment value and the msg field is a longtext type.

The following code should work just fine for inserting a record into the table:

$t = new Zend_Db_Table('table1');
$id = $t->insert(array('msg' => $content));

Whenever $content is just a plain string value like 'blah', it works just fine, like it should. But the fieldtype is not a longtext type for no reason, the content will be quite large. So now I try to place about 14kb of data in $content, no exception occurs, the database insert seems to have worked, but only for the first 6kb. The rest of the data is just gone?!

When I try to use to oldfashioned mysql_connect, mysql_query, etc routines, it all works like a charm. So it's really seems to be a Zend framework issue... Has anybody else experienced this?

Configuration

  • Zend Framework v1.11.10
  • Zend_Db_Table is configured with the PDO_MYSQL adapter
  • MySQL database table two columns; id (autoincrement)

Issue

  • Attempting to INSERT 14kb of UTF8-encoded HTML into longtext column
  • Zend_Db_Table truncates the data at 6kb

Tests

  • mysql_query can INSERT the same data without issue
  • Zend_Db_Table can SELECT all the data without issue
  • setting error_reporting(-1) reveals 'no errors, warnings or notices'
  • mediumblob works fine

Isolating the issue

  • Change the column to a mediumtext. Does the insert work now?
  • Have you checked what the query actually looks like? See comment above from namesnik.
  • How many bytes get written on the failed inserts? Is it consistent?