From: Antoine Musso Date: Mon, 16 Jan 2012 10:33:24 +0000 (+0000) Subject: Skip BrokenRedirectsPage query test under MySQL X-Git-Tag: 1.31.0-rc.0~25247 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=01b3af3ac6539c6011cce66934bf388157184620;p=lhc%2Fweb%2Fwiklou.git Skip BrokenRedirectsPage query test under MySQL The MySQL backend, when using temporary tables, does not support referencing a table which was already open. http://bugs.mysql.com/bug.php?id=10327 This patch skip BrokenRedirectsPage on MySQL as reported on r102411. --- diff --git a/tests/phpunit/includes/specials/QueryAllSpecialPagesTest.php b/tests/phpunit/includes/specials/QueryAllSpecialPagesTest.php index 95d60e980c..a33c7b6823 100644 --- a/tests/phpunit/includes/specials/QueryAllSpecialPagesTest.php +++ b/tests/phpunit/includes/specials/QueryAllSpecialPagesTest.php @@ -22,6 +22,16 @@ class QueryAllSpecialPagesTest extends MediaWikiTestCase { 'LinkSearchPage' ); + /** + * Pages whose query use the same DB table more than once. + * This is used to skip testing those pages when run against a MySQL backend + * which does not support reopening a temporary table. See upstream bug: + * http://bugs.mysql.com/bug.php?id=10327 + */ + protected $reopensTempTable = array( + 'BrokenRedirects', + ); + /** * Initialize all query page objects */ @@ -42,8 +52,20 @@ class QueryAllSpecialPagesTest extends MediaWikiTestCase { * @group Database */ function testQuerypageSqlQuery() { + global $wgDBtype; + foreach( $this->queryPages as $page ) { + // With MySQL, skips special pages reopening a temporary table + // See http://bugs.mysql.com/bug.php?id=10327 + if( + $wgDBtype === 'mysql' + && in_array( $page->getName(), $this->reopensTempTable ) + ) { + $this->markTestSkipped( "SQL query for page {$page->getName()} can not be tested on MySQL backend (it reopens a temporary table)" ); + continue; + } + $msg = "SQL query for page {$page->getName()} should give a result wrapper object" ; $result = $page->reallyDoQuery( 50 );