[MDEV-7777] Missing readline features when building with external libedit library Created: 2015-03-14 Updated: 2015-07-25 Resolved: 2015-07-25 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients |
| Affects Version/s: | 10.0.17 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Honza Horak | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Fedora |
||
| Attachments: |
|
| Description |
|
There are two issues related to external libedit reported for Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1187469 that non-ASCII characters don't work in interactive mode and https://bugzilla.redhat.com/show_bug.cgi?id=1180403 that backward search doesn't work. The problem is that mysql binary uses just readline() function from libedit library and this function only offers basic functionality. So generally, the possible fix is either to use el_wgets() function from libedit and configure the backward search feature in mysql binary or fix libedit's readline function to offer this by default (of as another function). Steps to Reproduce: Actual results:
background search in history doesn't work Expected results:
background search in history works Reproducible for example with mariadb-10.0.17-1.fc21. |
| Comments |
| Comment by Honza Horak [ 2015-03-14 ] |
|
Just FYI, examples/wtc1.c example from libedit-3.x tarball (http://sourceforge.net/projects/libedit/) shows how proper widechar support should be done (since libedit's readline() function includes just basics). I suppose something similar could be implemented into the mysql binary, so it is flexible in supporting advanced libedit features (non-ascii, backward history searchning, etc... either from external or bundled libedit). |
| Comment by Elena Stepanova [ 2015-03-15 ] |
|
See also |
| Comment by Honza Horak [ 2015-03-15 ] |
|
The more I'm thinking about this, the more I believe this should be fixed in system libedit in the first place, some more info at https://bugzilla.redhat.com/show_bug.cgi?id=1202022#c2 However, my previous comment about flexibility is still valid – if mariadb wants to be flexible about readline() configuration, it needs to re-implement this function itself.. |
| Comment by Sergei Golubchik [ 2015-07-25 ] |
|
Fixed upstream (in libedit). With recent libedit versions (I've tested libedit-20150325-3.1) multi-byte characters can be inserted just fine and backward search works too. |