Fixing behaviour with a table prefix
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 24 Oct 2004 08:04:18 +0000 (08:04 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 24 Oct 2004 08:04:18 +0000 (08:04 +0000)
maintenance/parserTests.php

index 548fd9e..1520502 100644 (file)
@@ -341,11 +341,11 @@ class ParserTest {
                                # "CREATE TEMPORARY TABLE ... SELECT * FROM ... LIMIT 0"
                                # would not create the indexes we need....
                                foreach ($tables as $tbl) {
-                                       $res = $db->query("SHOW CREATE TABLE $tbl");
+                                       $res = $db->query("SHOW CREATE TABLE {$this->oldTableNames[$tbl]}");
                                        $row = $db->fetchRow($res);
                                        $create = $row[1];
                                        $create_tmp = preg_replace('/CREATE TABLE `(.*?)`/', 'CREATE TEMPORARY TABLE `'
-                                               . $wgDBprefix . '\\1`', $create);
+                                               . $wgDBprefix . $tbl .'`', $create);
                                        if ($create === $create_tmp) {
                                                # Couldn't do replacement
                                                die("could not create temporary table $tbl");