X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fsql.php;h=8e276e77507b6ce4e15cb7e80fa2dbdde4805037;hb=3c0dac36eb60dfc6b34770d90af675bad5f18c0b;hp=36e55f3eed52d008e3b9b09de6abd003467121e3;hpb=89539f2aa1b158fdcc703ad053e2580cb97a6385;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/sql.php b/maintenance/sql.php index 36e55f3eed..8e276e7750 100644 --- a/maintenance/sql.php +++ b/maintenance/sql.php @@ -72,7 +72,7 @@ class MwSql extends Maintenance { } } if ( $index === null ) { - $this->error( "No replica DB server configured with the name '$replicaDB'.", 1 ); + $this->fatalError( "No replica DB server configured with the name '$replicaDB'." ); } } else { $index = DB_MASTER; @@ -81,7 +81,7 @@ class MwSql extends Maintenance { /** @var IDatabase $db DB handle for the appropriate cluster/wiki */ $db = $lb->getConnection( $index, [], $wiki ); if ( $replicaDB != '' && $db->getLBInfo( 'master' ) !== null ) { - $this->error( "The server selected ({$db->getServer()}) is not a replica DB.", 1 ); + $this->fatalError( "The server selected ({$db->getServer()}) is not a replica DB." ); } if ( $index === DB_MASTER ) { @@ -92,12 +92,12 @@ class MwSql extends Maintenance { if ( $this->hasArg( 0 ) ) { $file = fopen( $this->getArg( 0 ), 'r' ); if ( !$file ) { - $this->error( "Unable to open input file", true ); + $this->fatalError( "Unable to open input file" ); } $error = $db->sourceStream( $file, null, [ $this, 'sqlPrintResult' ] ); if ( $error !== true ) { - $this->error( $error, true ); + $this->fatalError( $error ); } else { exit( 0 ); } @@ -157,7 +157,11 @@ class MwSql extends Maintenance { $res = $db->query( $line ); $this->sqlPrintResult( $res, $db ); } catch ( DBQueryError $e ) { - $this->error( $e, $dieOnError ); + if ( $dieOnError ) { + $this->fatalError( $e ); + } else { + $this->error( $e ); + } } }