From 22b1c2a2f8fb108bb902ac1b958e27b7bb610ba9 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 12 Nov 2004 08:13:58 +0000 Subject: [PATCH] PG hack for temporary tables breaks MySQL 4.1. :P special-case it --- maintenance/parserTests.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.20.1