return $this->lastErrno() == 1205;
}
- /**
- * Begin a transaction, committing any previously open transaction
- * @deprecated use begin()
- */
- function immediateBegin( $fname = 'Database::immediateBegin' ) {
- $this->begin();
- }
-
- /**
- * Commit transaction, if one is open
- * @deprecated use commit()
- */
- function immediateCommit( $fname = 'Database::immediateCommit' ) {
- $this->commit();
- }
-
/**
* Return MW-style timestamp used for MySQL schema
*/
$blobsFile = popen( $sedCmd, 'r' );
$extdb->sourceStream( $blobsFile );
pclose( $blobsFile );
- $extdb->immediateCommit();
+ $extdb->commit();
}
}
$this->output( "False match\n" );
} else {
$dbw = wfGetDB( DB_MASTER );
- $dbw->immediateBegin();
+ $dbw->begin();
if ( !$rev ) {
// Didn't find a non-spammy revision, blank the page
$this->output( "blanking\n" );
$article = new Article( $title );
$article->updateArticle( $rev->getText(), wfMsg( 'spam_reverting', $domain ), false, false );
}
- $dbw->immediateCommit();
+ $dbw->commit();
wfDoUpdates();
}
}
$art = new Article( $page );
}
$success = $art->doDeleteArticle( $reason );
- $dbw->immediateCommit();
+ $dbw->commit();
if ( $success ) {
$this->output( "\n" );
} else {
$report = $this->hasOption('report');
$dbw = wfGetDB( DB_MASTER );
- $dbw->immediateBegin();
+ $dbw->begin();
list( $page, $revision ) = $dbw->tableNamesN( 'page', 'revision' );
# Find all the orphaned revisions
# Nothing to do?
if( $report || $count == 0 ) {
- $dbw->immediateCommit();
+ $dbw->commit();
exit(0);
}
$this->output( "done.\n" );
# Close the transaction and call the script to purge unused text records
- $dbw->immediateCommit();
+ $dbw->commit();
$this->purgeRedundantText( true );
}
if( $err !== true ) {
$this->output( "\nFAILED: $err" );
}
- $dbw->immediateCommit();
+ $dbw->commit();
$this->output( "\n" );
if ( $interval ) {
*/
private function doReassignEdits( &$from, &$to, $rc = false, $report = false ) {
$dbw = wfGetDB( DB_MASTER );
- $dbw->immediateBegin();
+ $dbw->begin();
# Count things
$this->output( "Checking current edits..." );
}
}
- $dbw->immediateCommit();
+ $dbw->commit();
return (int)$total;
}
$parserOutput = $wgParser->parse( $revision->getText(), $wgTitle, $options, true, true, $revision->getId() );
$update = new LinksUpdate( $wgTitle, $parserOutput, false );
$update->doUpdate();
- $dbw->immediateCommit();
+ $dbw->commit();
}
/*
'image' => 'img', 'oldimage' => 'oi' );
$count = 0;
- $dbo->immediateBegin();
+ $dbo->begin();
foreach( $checks as $table => $fprefix ) {
$conds = array( $fprefix . '_user' => $id );
$count += (int)$dbo->selectField( $table, 'COUNT(*)', $conds, __METHOD__ );
}
- $dbo->immediateCommit();
+ $dbo->commit();
return $count == 0;
}
$extdb->query( "ALTER TABLE {$from}.blobs RENAME TO {$to}.blobs" );
$extdb->selectDB( $from );
$extdb->sourceFile( $this->getDir() . '/storage/blobs.sql' );
- $extdb->immediateCommit();
+ $extdb->commit();
}
}
$this->output( "done.\n" );
$this->output( "Reconnected\n\n" );
} else {
# Commit the results
- $dbw->immediateCommit();
+ $dbw->commit();
}
# Wait for the slave to catch up
wfWaitForSlaves( 5 );