sebastianbergmann/phpunit — Issue #384: TRUNCATE statement fails due to FK constraints
Author: alcohol
Created: 2011-10-26 15:52:48+00:00
State: open

When extending PHPUnit_Extensions_Database_TestCase, a TRUNCATE statement seems to be executed for all tables found in the fixture. These TRUNCATE statements result in an Exception.

The actual cause for this error is because I am running MySQL 5.5.

In the manual I found @ http://dev.mysql.com/doc/refman/5.1/en/truncate-table.html

> "In MySQL 5.5 and higher, TRUNCATE TABLE is not allowed for InnoDB tables referenced by foreign keys. For ease of upgrading, rewrite such statements to use DELETE instead."