Bug #69991 MySQL client is broken without readline

Submitted: 12 Aug 2013 8:41 Modified: 13 Jan 2015 15:14
Reporter: Justin Swanhart Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S1 (Critical)
Version:5.6.13 OS:Linux
Assigned to: CPU Architecture:Any

[12 Aug 2013 8:41] Justin Swanhart
Description:
I removed all MySQL packages from the system:
rpm --erase $(rpm -qa|grep -i mysql)

I then install MySQL 5.6 from rpm tarball

It seems to come with readline.

If I have old .mysql_history then very weird things can happen which really break the new client.

Further, even if the .mysql_history file was not there, there are issue:
moving forward/backward in history with up/down is per-sql-line, instead of combining a complete SQL statement together
CTRL-R backwards searching does not work
CTRL-A/CTRL-E/etc no longer work as expected
most other editline shortcuts are broken. 

How to repeat:
use the new client

Suggested fix:
go back to readline
[12 Aug 2013 8:41] Justin Swanhart
It seems to come with editline not readline.  Sorry.  It is late where I am at.
[26 Aug 2013 7:36] MySQL Verification Team
Hello Justin,

Thank you for the bug report.
Verified as described.

Thanks,
Umesh
[8 Oct 2013 19:23] Justin Swanhart
update synopsis - was backwards
[9 Apr 2014 17:46] Jonathan Nicol
this is killing me... every time I want to erase the previous word with ctrl-w and it takes the entire line, I scream. Pretty please fix this trivial packaging issue ASAP :)
[20 Aug 2014 23:46] Mike Griffin
^w acting as ^u is insanely annoying

^u actually kills in both directions while ^k works as expected

Just wanted to wish this bug a happy birthday.
[9 Oct 2014 22:51] Brendan Byrd
FYI, MySQL does have some tips on using libedit, including using the .editrc to fix certain control codes:

http://dev.mysql.com/doc/refman/5.6/en/mysql-tips.html
[10 Oct 2014 0:03] Mike Griffin
Fair enough, I am using the wrong key strokes for libedit and should get used to the new functionality.

Just retested some of the complaints with the newest version:

mysql --help | head -1
mysql  Ver 14.14 Distrib 5.6.21, for Linux (x86_64) using  EditLine wrapper

The history for a multi line query was collapsed to a single line [check]

CTRL-R backwards searching worked [check]

Testing the .editrc seemed to indicate that it was parsed correctly, 'bind "^W" ed-delete-prev-word' worked as configured [check]

Perhaps this bug is solved as well as can be expected. Justin?
[10 Jan 2015 10:34] Daniël van Eeden
From which bug is this a duplicate?
[10 Jan 2015 11:36] Shane Bester
Is a duplicate of these:
Bug 14634386 - HISTORY WRITTEN BY LIBEDIT IS NOT READABLE BY READLINE 
Bug 16633124 - COMPATIBILITY ISSUE WITH MYSQL HISTORY ("\040" INSTEAD OF SPACE) 
http://bugs.mysql.com/bug.php?id=68925
[13 Jan 2015 15:14] Stefan Hinz
Closed by mistake, sorry. Reopened. -Stefan
[9 Sep 2015 14:44] Are you mortal Then prepare to die.
Not 100% sure if this is related to this issue, but I found \n in my prompt is no-longer respected.
[22 May 2017 15:23] Raphaël Droz
.editrc is far from offering the features of readline's .inputrc (won't clutter the bugreport all the examples).
I didn't about the rational for leaving readline, but IHMO it's not a very good choice.
readline is much more powerful and should rather be the default of the mysql-community-client.

(https://github.com/percona/percona-server/pull/57)

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.066 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.