The cache table is wrong. It stores the gzipped cached text as LONGTEXT. This breaks with new MySQL when the database charset is set to UTF-8.
It should be LONGBLOB instead.

CREATE TABLE cache (
  cid varchar(255) NOT NULL default '',
  data longblob,
  expire int(11) NOT NULL default '0',
  created int(11) NOT NULL default '0',
  headers text,
  PRIMARY KEY  (cid),
  KEY expire (expire)
)

Comments

killes@www.drop.org’s picture

What mysql version are you talking about? Drupal tries to be agnostic about the encodign settings of the database.

decafdennis’s picture

Priority: Minor » Critical

I've been getting blank pages lately, after they have been cached. I found out that only an A with a circumflex was saved to the cache table, instead of the gzipped page. Changing the data column type from LONGTEXT to LONGBLOB fixed this problem. MySQL appearently couldn't save the gzipped binary data to the longtext field.

I must say that this bug just came out of nothing. I updated Drupal from CVS today, and as far as I could see no changes were made to anything related to caching or the cache table.

I am using PHP 4.4.0 and MySQL 4.1.14. If you were wondering, I have not updated any of those lately.

That the data column should be a LONGBLOB seems logical to me, since it has to store binary data. But I still find it strange that it still worked yesterday...

Wesley Tanaka’s picture

http://drupal.org/node/40532
has a patch against CVS head which I believe also deals with the schema update

Wesley Tanaka’s picture

Status: Active » Closed (duplicate)

marking as dupe of http://drupal.org/node/40532
since it looks like that patch might be accepted.