mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX: Use DELETE FROM instead of TRUNCATE for clearTable
clearTable is mainly used for clearing data between tests. In this case, there are very few or zero records, and DELETE FROM is quicker than TRUNCATE, which works by deleting and recreating the table. This materially speeds up test execution, at least on MySQL. Implemented in SS3 at 815da76b056a716c8831d22bbf93528912cbcb28
This commit is contained in:
parent
755907d117
commit
79c2b5ad42
@ -403,7 +403,7 @@ abstract class Database
|
||||
*/
|
||||
public function clearTable($table)
|
||||
{
|
||||
$this->query("TRUNCATE \"$table\"");
|
||||
$this->query("DELETE FROM \"$table\"");
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user