Fix:
Bug 29912 - Unit tests break if parsertest tables are still present
The parserTest suite duplicate available tables. When using temporary table
it assumed every table are temporary. Under SQLite searchindex is a virtual
table and thus remained after a run of parserTests.php
As a side effect, when running the PHPUnit with that remaining table, it
caused a nice error:
The last attempted database query was:
"DELETE FROM unittest_parsertest_searchindex"
from within function "MediaWikiTestCase::resetDB".
Database returned error "1: SQL logic error or missing database"
This patch is not needed for REL1_18 continuous integration since we
never run the parserTests.php script.
suppressed
* (bug 31921) Magic words REVISIONDAY, REVISIONMONTH and REVISIONYEAR now give
current values on preview
+* (bug 29912) Unit tests break if parsertest tables are still present
=== API changes in 1.19 ===
* (bug 19838) siprop=interwikimap can now use the interwiki cache.
$this->databaseSetupDone = false;
if ( $this->useTemporaryTables ) {
+ if( $this->db->getType() == 'sqlite' ) {
+ # Under SQLite the searchindex table is virtual and need
+ # to be explicitly destroyed. See bug 29912
+ # See also MediaWikiTestCase::destroyDB()
+ wfDebug( __METHOD__ . " explicitly destroying sqlite virtual table parsertest_searchindex\n" );
+ $this->db->query( "DROP TABLE `parsertest_searchindex`" );
+ }
# Don't need to do anything
$this->teardownGlobals();
return;