Bug #91385 History search (Ctrl-R) is broken on mysql command
Submitted: 23 Jun 2018 14:09
Reporter: Mikiya Okuno Email Updates:
Status: Verified Impact on me:
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:8.0.11, 5.7.22 OS:Linux (Gentoo)
Assigned to: CPU Architecture:Any

[23 Jun 2018 14:09] Mikiya Okuno
History search (Ctrl-R) is broken on Linux. I just tested some Linux distributions, but it should happen on other operating systems. When I type Ctrl-R and some keys, the console output is broken like below:

bck:s> show engine innodb status\G
mysql> show engine innodb statu
bck:show e
bck:show en
bck:show eng
bck:show engi
bck:show engin
mysql> w engine
mysql> w engine i
mysql> w engine in
mysql> w engine inn
mysql> w engine inno
mysql> w engine innod
mysql> w engine innodb
mysql> w engine innodb s
mysql> w engine innodb st
mysql> w engine innodb sta
mysql> w engine innodb stat
mysql> w engine innodb statu
mysql> w engine innodb status

I just entered "show engine innodb status" in this case. There is a command history of "show engine innodb status\G".

How to repeat:
Run mysql client, then type Ctrl-R, then input some words. You'll find that the console is broken.

Suggested fix:
I see the same problem on MySQL Shell 8.0.0 or older. However, it was fixed on MySQL Shell 8.0.3.

The mysql command should be fixed just like what MySQL Shell did.

The problem also happens on MySQL 5.7 series. A fix should be backported.