Last modified: 2013-06-18 16:56:40 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29207, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27207 - maintenance/sql.php should use Maintenance::readConsole to provide readline editing
maintenance/sql.php should use Maintenance::readConsole to provide readline e...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Maintenance scripts (Other open bugs)
1.18.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-06 21:36 UTC by Brion Vibber
Modified: 2013-06-18 16:56 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Brion Vibber 2011-02-06 21:36:51 UTC
sql.php seems to be optimized for running pre-prepared scripts, which is all well and good but it would be nice to get the GNU readline goodies when stdin is actually a terminal.

The readline stuff is encapsulated in Maintenance::readConsole() which'll return a line at a time.

Looks like sql.php sends stdin straight into Database::sourceStream() which does fgets() directly... that'll probably need to be extended to add a callback to override the actual reading, or else clever use of stream wrappers. :)
Comment 1 Antoine "hashar" Musso (WMF) 2012-05-22 13:43:17 UTC
It looks like this issue has been fixed or maybe I am not understand it. From sql.php :
  while ( ( $line = Maintenance::readconsole() ) !== false ) {

commit ebf916f3fb528bba0fcb5626701815a1810463de

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links