When an erroneous query is entered into sql.php, it doesn't clear its
line buffer, so the intended next query (often fixing a typo in the
original) winds up concatenated onto the erroneous query. Usually
leading to another error, which repeats the process.
The solution is simple enough: clear the line buffer unconditionally,
not only when no exception is caught.
Change-Id: Ia78e2df8b9c6698c0a225bfb3135274ed8da5303
try {
$res = $db->query( $wholeLine );
$this->sqlPrintResult( $res, $db );
- $prompt = $newPrompt;
- $wholeLine = '';
} catch ( DBQueryError $e ) {
$doDie = !Maintenance::posix_isatty( 0 );
$this->error( $e, $doDie );
}
+ $prompt = $newPrompt;
+ $wholeLine = '';
}
wfWaitForSlaves();
}