r101002 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101001‎ | r101002 | r101003 >
Date:17:12, 27 October 2011
Author:hashar
Status:ok
Tags:
Comment:
parsertest now destroy virtual table under SQLite

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.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/tests/parser/parserTest.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -117,6 +117,7 @@
118118 suppressed
119119 * (bug 31921) Magic words REVISIONDAY, REVISIONMONTH and REVISIONYEAR now give
120120 current values on preview
 121+* (bug 29912) Unit tests break if parsertest tables are still present
121122
122123 === API changes in 1.19 ===
123124 * (bug 19838) siprop=interwikimap can now use the interwiki cache.
Index: trunk/phase3/tests/parser/parserTest.inc
@@ -868,6 +868,13 @@
869869 $this->databaseSetupDone = false;
870870
871871 if ( $this->useTemporaryTables ) {
 872+ if( $this->db->getType() == 'sqlite' ) {
 873+ # Under SQLite the searchindex table is virtual and need
 874+ # to be explicitly destroyed. See bug 29912
 875+ # See also MediaWikiTestCase::destroyDB()
 876+ wfDebug( __METHOD__ . " explicitly destroying sqlite virtual table parsertest_searchindex\n" );
 877+ $this->db->query( "DROP TABLE `parsertest_searchindex`" );
 878+ }
872879 # Don't need to do anything
873880 $this->teardownGlobals();
874881 return;

Follow-up revisions

RevisionCommit summaryAuthorDate
r102535MFT to REL1_18 r101002...hashar17:12, 9 November 2011
r102536move bug 29912 RN form 1.19 to 1.18...hashar17:14, 9 November 2011

Status & tagging log