Description:
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:
mysql>
bck:l>
bck:s> show engine innodb status\G
mysql> show engine innodb statu
bck:sho
bck:show
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.