Index: trunk/phase3/tests/phpunit/includes/specials/QueryAllSpecialPagesTest.php |
— | — | @@ -23,6 +23,16 @@ |
24 | 24 | ); |
25 | 25 | |
26 | 26 | /** |
| 27 | + * Pages whose query use the same DB table more than once. |
| 28 | + * This is used to skip testing those pages when run against a MySQL backend |
| 29 | + * which does not support reopening a temporary table. See upstream bug: |
| 30 | + * http://bugs.mysql.com/bug.php?id=10327 |
| 31 | + */ |
| 32 | + protected $reopensTempTable = array( |
| 33 | + 'BrokenRedirects', |
| 34 | + ); |
| 35 | + |
| 36 | + /** |
27 | 37 | * Initialize all query page objects |
28 | 38 | */ |
29 | 39 | function __construct() { |
— | — | @@ -42,8 +52,20 @@ |
43 | 53 | * @group Database |
44 | 54 | */ |
45 | 55 | function testQuerypageSqlQuery() { |
| 56 | + global $wgDBtype; |
| 57 | + |
46 | 58 | foreach( $this->queryPages as $page ) { |
47 | 59 | |
| 60 | + // With MySQL, skips special pages reopening a temporary table |
| 61 | + // See http://bugs.mysql.com/bug.php?id=10327 |
| 62 | + if( |
| 63 | + $wgDBtype === 'mysql' |
| 64 | + && in_array( $page->getName(), $this->reopensTempTable ) |
| 65 | + ) { |
| 66 | + $this->markTestSkipped( "SQL query for page {$page->getName()} can not be tested on MySQL backend (it reopens a temporary table)" ); |
| 67 | + continue; |
| 68 | + } |
| 69 | + |
48 | 70 | $msg = "SQL query for page {$page->getName()} should give a result wrapper object" ; |
49 | 71 | |
50 | 72 | $result = $page->reallyDoQuery( 50 ); |