diff --git a/cake/libs/model/datasources/dbo/dbo_mysql.php b/cake/libs/model/datasources/dbo/dbo_mysql.php index b5b8fd900..0a0c3e300 100644 --- a/cake/libs/model/datasources/dbo/dbo_mysql.php +++ b/cake/libs/model/datasources/dbo/dbo_mysql.php @@ -562,7 +562,7 @@ class DboMysql extends DboSource { $out = ''; foreach ($schema->tables as $curTable => $columns) { if (!$table || $table == $curTable) { - $out .= 'DROP TABLE IF EXISTS ' . $this->fullTableName($curTable) . ";\n"; + $out .= 'DROP TABLE ' . $this->fullTableName($curTable) . ";\n"; } } return $out; diff --git a/cake/tests/lib/cake_test_case.php b/cake/tests/lib/cake_test_case.php index 8c45ad771..685caf86e 100644 --- a/cake/tests/lib/cake_test_case.php +++ b/cake/tests/lib/cake_test_case.php @@ -353,7 +353,14 @@ class CakeTestCase extends UnitTestCase { */ function start() { if (isset($this->_fixtures) && isset($this->db)) { + $cacheSources = $this->db->cacheSources; + $this->db->cacheSources = false; + $sources = $this->db->listSources(); + $this->db->cacheSources = $cacheSources; foreach ($this->_fixtures as $fixture) { + if (in_array($fixture->table, $sources)) { + $fixture->drop($this->db); + } $fixture->create($this->db); } }