Skip to content
This repository has been archived by the owner on Dec 9, 2023. It is now read-only.

[BUGFIX] Only clean up tables that have a dummy column #79

Merged
merged 1 commit into from
Nov 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ This project adheres to [Semantic Versioning](https://semver.org/).
- Remove the obsolete ext_autoload.php (#56)

### Fixed
- Only clean up tables that have a dummy column (#79)
- Fix the PHAR inclusion in TYPO3 8.7.17 (#59, #60)
- Only include the PHAR from the test runners (#57, #53)
- Use the DB name from the connection pool in TYPO3 >= 8.7 (#58, #55)
Expand Down
14 changes: 7 additions & 7 deletions Classes/Framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -852,8 +852,8 @@ public function cleanUp($performDeepCleanUp = false)
* issue.
*
* @param bool $useSystemTables
* whether to clean up the system tables (TRUE) or the non-system
* test tables (FALSE)
* whether to clean up the system tables (true) or the non-system
* test tables (false)
* @param bool $performDeepCleanUp
* whether a deep clean up should be performed
*
Expand All @@ -869,17 +869,17 @@ protected function cleanUpTableSet($useSystemTables, $performDeepCleanUp)

foreach ($tablesToCleanUp as $currentTable) {
$dummyColumnName = $this->getDummyColumnName($currentTable);
if (!\Tx_Phpunit_Service_Database::tableHasColumn($currentTable, $dummyColumnName)) {
continue;
}

// Runs a delete query for each allowed table. A
// "one-query-deletes-them-all" approach was tested but we did not
// find a working solution for that.
// Runs a delete query for each allowed table. A "one-query-deletes-them-all" approach was tested,
// but we didn't find a working solution for that.
\Tx_Phpunit_Service_Database::delete($currentTable, $dummyColumnName . ' = 1');

// Resets the auto increment setting of the current table.
$this->resetAutoIncrementLazily($currentTable);
}

// Resets the list of dirty tables.
$this->dirtyTables = [];
}

Expand Down