r88155 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88154‎ | r88155 | r88156 >
Date:11:29, 15 May 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
fixed pg bug when running update, last issue of bug 26202
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLHelpers.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLHelpers.php
@@ -260,11 +260,11 @@
261261 $typeold = ( $notnullposold > 0 ) ? substr( $currentFields[$name], 0, $notnullposold ) : $currentFields[$name];
262262
263263 if ( $typeold != $type ) {
264 - $db->query( "ALTER TABLE \"" . $tableName . "\" ALTER COLUMN \"" . $name . "\" ENGINE " . $type, __METHOD__ );
 264+ $db->query( "ALTER TABLE " . $tableName . " ALTER COLUMN \"" . $name . "\" ENGINE " . $type, __METHOD__ );
265265 }
266266
267267 if ( $notnullposold != $notnullposnew ) {
268 - $db->query( "ALTER TABLE \"" . $tableName . "\" ALTER COLUMN \"" . $name . "\" " . ( $notnullposnew > 0 ? 'SET' : 'DROP' ) . " NOT NULL", __METHOD__ );
 268+ $db->query( "ALTER TABLE " . $tableName . " ALTER COLUMN \"" . $name . "\" " . ( $notnullposnew > 0 ? 'SET' : 'DROP' ) . " NOT NULL", __METHOD__ );
269269 }
270270
271271 self::reportProgress( "done.\n", $reportTo );
@@ -357,7 +357,9 @@
358358 $column = $index;
359359 }
360360
361 - $db->query( "CREATE $type {$rawTableName}_index{$key} ON $tableName USING btree(" . $column . ")", __METHOD__ );
 361+ if ( $db->indexInfo( $rawTableName, "{$rawTableName}_index{$key}" ) === false ) {
 362+ $db->query( "CREATE $type {$rawTableName}_index{$key} ON $tableName USING btree(" . $column . ")", __METHOD__ );
 363+ }
362364 }
363365 }
364366 } else { // MySQL

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r88128apply patch from bug 26202jeroendedauw23:40, 14 May 2011

Status & tagging log