2010年7月8日星期四

Re: [fw-db] Zend_DB error : Mysqli statement execute error : Prepared statement needs to be re-prepared

This is a MySQL error, not a Zend Framework error.

Automatic statement re-preparation occurs automatically if you have an
outstanding prepared statement when you do a DDL operation such as
create, alter, truncate or flush tables.
See http://dev.mysql.com/doc/refman/5.1/en/statement-repreparation.html

I would guess that your unit tests are doing some DDL operations in
their setup and teardown, and that you aren't freeing prepared
statements. In the Db unit tests I designed for Zend_Db, I close the
Db connection after each test, which should free any prepared
statements.

You could also explicitly call $stmt->close() before leaving each unit
test to free the prepared statement, so MySQL knows it doesn't have to
be re-prepared.

Regards,
Bill Karwin

On Jul 8, 2010, at 7:41 AM, CedricG wrote:

>
> Hello,
>
> the full error is "Zend_Db_Statement_Mysqli_Exception: Mysqli
> statement
> execute error : Prepared statement needs to be re-prepared"
>
> It occurs only on our unit tests server, but not on all run (it run
> tests
> every hour), and not on all test wich use database. We only have 111
> PHPunit
> tests.
> The test server is a Linux Centos5 with PHP 5.2.10, and we use Zend
> Framework 1.10.0.

没有评论: