aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/convertLinks.inc
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/convertLinks.inc')
-rw-r--r--maintenance/convertLinks.inc13
1 files changed, 7 insertions, 6 deletions
diff --git a/maintenance/convertLinks.inc b/maintenance/convertLinks.inc
index f56a771f9649..c9b7fb54cbe6 100644
--- a/maintenance/convertLinks.inc
+++ b/maintenance/convertLinks.inc
@@ -31,20 +31,21 @@ function convertLinks() {
$perfLogFilename = "convLinksPerf.txt";
#--------------------------------------------------------------------
+ $res = wfQuery( "SELECT l_from FROM links LIMIT 1", DB_READ );
+ if ( mysql_field_type( $res, 0 ) == "int" ) {
+ print "Schema already converted\n";
+ return;
+ }
+
$res = wfQuery( "SELECT COUNT(*) AS count FROM links", DB_WRITE );
$row = wfFetchObject($res);
$numRows = $row->count;
wfFreeResult( $res );
if ( $numRows == 0 ) {
- print "No rows to convert. Updating schema...\n";
+ print "Updating schema (no rows to convert)...\n";
createTempTable();
} else {
- $res = wfQuery( "SELECT l_from FROM links LIMIT 1", DB_READ );
- if ( mysql_field_type( $res, 0 ) == "int" ) {
- print "Schema already converted\n";
- return;
- }
if ( $logPerformance ) { $fh = fopen ( $perfLogFilename, "w" ); }
$baseTime = $startTime = getMicroTime();
# Create a title -> cur_id map