After a recent upgrade, we started seeing messages like:
MySQL generated an error.This user is not logged in.Apache environment:
    SCRIPT_URI = http://chess.eecs.berkeley.edu/pubs/203.html
    HTTP_REFERER = 
    REMOTE_HOST = 

The error message is:
sqli_prepared_query(): $statement->execute() failed!
Last statement error: (1615) Prepared statement needs to be re-prepared
Stacktrace:
  at sqli_error(/export/home/www/php/include/sqli.inc.php:171)
  at sqli_prepared_query(/export/home/www/php/include/sqli.inc.php:591)
  at sqli_prepared_select_row(/export/home/www/php/include/sqli.inc.php:730)
  at sqli_select_row(/export/home/www/php/include/sqli.inc.php:835)
  at group_get(/export/home/www/php/include/group.inc.php:409)
  at include(/export/home/www/php/chess.eecs.berkeley.edu/get.php:102)
  at /export/home/www/php/get.php:40

------------------------------------------
This error last occurred 14 times between
11:40:09 PM 12/14/10 and 11:40:09 PM 12/14/10
 with no mail sent to avoid an unmanageable deluge of email.

To delete the file keeping track of these repeated error messages,
log onto andrews as root and
        rm -f  /home/www/wwwdata/delugeMail/31b0d3d2f569b86030e2bdf939ee425e
Searching for "Prepared statement needs to be re-prepared" yielded http://stackoverflow.com/questions/4380813/how-to-get-rid-of-mysql-error-prepared-statement-needs-to-be-re-prepared which suggested

This is a possibility: MySQL bug #42041

They suggest upping the value of table_definition_cache.

You can read about re-preparation in the MySQL docs.

http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html#sysvar_table_definition_cache says that the default value is 256.
The number of table definitions that can be stored in the definition cache. If you use a large number of tables, you can create a large table definition cache to speed up opening of tables. The table definition cache takes less space and does not use file descriptors, unlike the normal table cache. This variable was added in MySQL 5.1.3. The minimum and default values are 1 and 128 before MySQL 5.1.25. The minimum and default are both 256 as of MySQL 5.1.25.
To increase the size, I edited /etc/my.cnf and add
table_definition_cache=512