sql.php in interactive no more exit on DBerror
authorAntoine Musso <hashar@free.fr>
Thu, 25 Oct 2012 11:14:24 +0000 (13:14 +0200)
committerAntoine Musso <hashar@free.fr>
Thu, 25 Oct 2012 11:14:24 +0000 (13:14 +0200)
This patch make it so that after a DBerror a new prompt is shown to the
user. Save us from having to relaunch sql.php.

Change-Id: Id3df3df87f6fe7b2aea31e0526c5ff697bc5832c

maintenance/sql.php

index 04e98d9..e8e8cb4 100644 (file)
@@ -80,7 +80,8 @@ class MwSql extends Maintenance {
                                $this->sqlPrintResult( $res, $dbw );
                                $wholeLine = '';
                        } catch (DBQueryError $e) {
-                               $this->error( $e, true );
+                               $doDie = ! Maintenance::posix_isatty( 0 );
+                               $this->error( $e, $doDie );
                        }
                }
        }