Index: trunk/phase3/maintenance/tests/SearchMySQLTest.php |
— | — | @@ -7,7 +7,7 @@ |
8 | 8 | function setUp() { |
9 | 9 | $GLOBALS['wgContLang'] = new Language; |
10 | 10 | $this->db = $this->buildTestDatabase( |
11 | | - array( 'page', 'revision', 'text', 'searchindex' ) ); |
| 11 | + array( 'page', 'revision', 'text', 'searchindex', 'user' ) ); |
12 | 12 | if( $this->db ) { |
13 | 13 | $this->insertSearchData(); |
14 | 14 | } |
Index: trunk/phase3/maintenance/tests/MediaWiki_Setup.php |
— | — | @@ -12,31 +12,11 @@ |
13 | 13 | $db->tablePrefix( 'parsertest_' ); |
14 | 14 | |
15 | 15 | if( $db->isOpen() ) { |
16 | | - if ( !( strcmp( $db->getServerVersion(), '4.1' ) < 0 and $db->getType() == 'mysql' ) ) { |
17 | | - # Database that supports CREATE TABLE ... LIKE |
18 | | - foreach ( $tables as $tbl ) { |
19 | | - $newTableName = $db->tableName( $tbl ); |
20 | | - $tableName = $oldTableNames[$tbl]; |
21 | | - $db->query( "CREATE TEMPORARY TABLE $newTableName (LIKE $tableName)" ); |
22 | | - } |
23 | | - } else { |
24 | | - # Hack for MySQL versions < 4.1, which don't support |
25 | | - # "CREATE TABLE ... LIKE". Note that |
26 | | - # "CREATE TEMPORARY TABLE ... SELECT * FROM ... LIMIT 0" |
27 | | - # would not create the indexes we need.... |
28 | | - foreach ( $tables as $tbl ) { |
29 | | - $res = $db->query( "SHOW CREATE TABLE $tbl" ); |
30 | | - $row = $db->fetchRow($res); |
31 | | - $create = $row[1]; |
32 | | - $create_tmp = preg_replace( '/CREATE TABLE `(.*?)`/', 'CREATE TEMPORARY TABLE `' |
33 | | - . $wgDBprefix . '\\1`', $create ); |
34 | | - if ($create === $create_tmp) { |
35 | | - # Couldn't do replacement |
36 | | - wfDie( "could not create temporary table $tbl" ); |
37 | | - } |
38 | | - $db->query( $create_tmp ); |
39 | | - } |
40 | | - |
| 16 | + foreach ( $tables as $tbl ) { |
| 17 | + $newTableName = $db->tableName( $tbl ); |
| 18 | + $tableName = $oldTableNames[$tbl]; |
| 19 | + $db->query( "DROP TABLE IF EXISTS $newTableName", __METHOD__ ); |
| 20 | + $db->duplicateTableStructure( $tableName, $newTableName, __METHOD__ ); |
41 | 21 | } |
42 | 22 | return $db; |
43 | 23 | } else { |