Zend Framework

Zend_Test_PHPUnit_Db_Operation_Truncate should truncate tables in reversed order.

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.3
  • Fix Version/s: 1.9.4
  • Component/s: Zend_Test_PHPUnit
  • Labels:
    None

Description

MySQL database contains InnoDB tables with foreign keys. In XML dataset tables are described in such order, that insertion would go along with existing DB constraints. Method "execute" in "Zend_Test_PHPUnit_Db_Operation_Truncate" class tries to truncate them in same order and fails because of DB constraints. Truncating tables in reverse order would solve the problems as dependent rows would be removed before rows they depend upon.

Changing row 61 in file "Zend/Test/PHPUnit/Db/Operation/Truncate.php" to

foreach ($dataSet->getReverseIterator() as $table)

solved the problem. This applies to Zend Framework release 1.9.3PL1.

Activity

Hide
Matthew Weier O'Phinney added a comment -

Assigning to Ben Eberlei

Show
Matthew Weier O'Phinney added a comment - Assigning to Ben Eberlei
Hide
Benjamin Eberlei added a comment -

I patched this in trunk already, however it seems the test for it fail on 1.9 release branch, because of some missing bug i forgot to merge into 1.9 from zend test dbadapter. I do the merge into 1.9 later and then close the bug

Show
Benjamin Eberlei added a comment - I patched this in trunk already, however it seems the test for it fail on 1.9 release branch, because of some missing bug i forgot to merge into 1.9 from zend test dbadapter. I do the merge into 1.9 later and then close the bug
Hide
Benjamin Eberlei added a comment -

Merged into 1.9 release branch, tests now pass

Show
Benjamin Eberlei added a comment - Merged into 1.9 release branch, tests now pass

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: