From: Brion Vibber Date: Fri, 12 Nov 2004 08:13:58 +0000 (+0000) Subject: PG hack for temporary tables breaks MySQL 4.1. :P special-case it X-Git-Tag: 1.5.0alpha1~1375 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=22b1c2a2f8fb108bb902ac1b958e27b7bb610ba9;p=lhc%2Fweb%2Fwiklou.git PG hack for temporary tables breaks MySQL 4.1. :P special-case it --- diff --git a/maintenance/parserTests.php b/maintenance/parserTests.php index 1d8a7e3f0b..574f6969ea 100644 --- a/maintenance/parserTests.php +++ b/maintenance/parserTests.php @@ -339,10 +339,16 @@ class ParserTest { if (!(strcmp($db->getServerVersion(), '4.1') < 0 and stristr($db->getSoftwareLink(), 'MySQL'))) { # Database that supports CREATE TABLE ... LIKE + global $wgDBtype; + if( $wgDBtype == 'PostgreSQL' ) { + $def = 'INCLUDING DEFAULTS'; + } else { + $def = ''; + } foreach ($tables as $tbl) { $newTableName = $db->tableName( $tbl ); $tableName = $this->oldTableNames[$tbl]; - $db->query("CREATE TEMPORARY TABLE $newTableName (LIKE $tableName INCLUDING DEFAULTS)"); + $db->query("CREATE TEMPORARY TABLE $newTableName (LIKE $tableName $def)"); } } else { # Hack for MySQL versions < 4.1, which don't support