if ( $dbw->tableExists( 'pagelinks' ) ) {
$this->output( "...have pagelinks; skipping old links table updates\n" );
if ( $dbw->tableExists( 'pagelinks' ) ) {
$this->output( "...have pagelinks; skipping old links table updates\n" );
return;
}
$res = $dbw->query( "SELECT l_from FROM $links LIMIT 1" );
if ( $dbw->fieldType( $res, 0 ) == "int" ) {
$this->output( "Schema already converted\n" );
return;
}
$res = $dbw->query( "SELECT l_from FROM $links LIMIT 1" );
if ( $dbw->fieldType( $res, 0 ) == "int" ) {
$this->output( "Schema already converted\n" );
- $this->performanceLog ( $fh, "Reading $numRows rows from cur table...\n" );
- $this->performanceLog ( $fh, "rows read vs seconds elapsed:\n" );
+ $this->performanceLog( $fh, "Reading $numRows rows from cur table...\n" );
+ $this->performanceLog( $fh, "rows read vs seconds elapsed:\n" );
$dbw->bufferResults( false );
$res = $dbw->query( "SELECT cur_namespace,cur_title,cur_id FROM $cur" );
$dbw->bufferResults( false );
$res = $dbw->query( "SELECT cur_namespace,cur_title,cur_id FROM $cur" );
# convert, and write to the new table.
$this->createTempTable();
$this->performanceLog( $fh, "Resetting timer.\n\n" );
# convert, and write to the new table.
$this->createTempTable();
$this->performanceLog( $fh, "Resetting timer.\n\n" );
$this->output( "Processing $numRows rows from $links table...\n" );
$this->performanceLog( $fh, "Processing $numRows rows from $links table...\n" );
$this->performanceLog( $fh, "rows inserted vs seconds elapsed:\n" );
$this->output( "Processing $numRows rows from $links table...\n" );
$this->performanceLog( $fh, "Processing $numRows rows from $links table...\n" );
$this->performanceLog( $fh, "rows inserted vs seconds elapsed:\n" );
$this->output( "Creating temporary links table..." );
if ( $this->hasOption( 'noKeys' ) ) {
$dbConn->query( "CREATE TABLE $links_temp ( " .
$this->output( "Creating temporary links table..." );
if ( $this->hasOption( 'noKeys' ) ) {
$dbConn->query( "CREATE TABLE $links_temp ( " .
- "l_from int(8) unsigned NOT NULL default '0', " .
- "l_to int(8) unsigned NOT NULL default '0')" );
+ "l_from int(8) unsigned NOT NULL default '0', " .
+ "l_to int(8) unsigned NOT NULL default '0')" );
- "l_from int(8) unsigned NOT NULL default '0', " .
- "l_to int(8) unsigned NOT NULL default '0', " .
- "UNIQUE KEY l_from(l_from,l_to), " .
- "KEY (l_to))" );
+ "l_from int(8) unsigned NOT NULL default '0', " .
+ "l_to int(8) unsigned NOT NULL default '0', " .
+ "UNIQUE KEY l_from(l_from,l_to), " .
+ "KEY (l_to))" );
-
- private function getMicroTime() { # return time in seconds, with microsecond accuracy
- list( $usec, $sec ) = explode( " ", microtime() );
- return ( (float)$usec + (float)$sec );
- }