Bug #77148 mysql client - display issue when resizing terminal
Submitted: 25 May 2015 12:18 Modified: 26 May 2015 7:56
Reporter: Tomislav Plavcic Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.6.24 OS:Linux
Assigned to: CPU Architecture:Any

[25 May 2015 12:18] Tomislav Plavcic
Description:
I'm using latest Mysql Server 5.6.24 on centos6 and connect to machine using putty client.

If after starting mysql client we resize putty window there are issues with command line display in some scenarios (steps explained below) - client repeats some part of command line from before and it looks messy.
The command is executed normally after pressing "enter" but it looks confusing (even more when long queries are used).
We noticed this is true only for mysql client built with Editline, when it is built with readline this works normally.

How to repeat:
Client used:
[vagrant@t-centos6-64 ~]$ mysql --version
mysql  Ver 14.14 Distrib 5.6.24, for Linux (x86_64) using  EditLine wrapper

1. 
Run client from inside putty:
$ mysql -u root
<resize putty window >
press up arrow to call last command
command line in mysql client looks something like this (notice 2x mysql>):
mysql> mysql> show databases;

But when "enter" is pressed it executes correctly, but it doesn't look ok.

2.
Same thing happens with long queries that wrap into new line and when we use tab for completion.
When after resizing pressing tab for completion I got command line that looks like this (using mysql database):
mysql> select Host, User from user 
where Hmysql> select Host, User from user where H

In the second line after "where H" I pressed tab wanting completion but it just messes that second line.

If I try to repeat the same on 5.5.43 it works normally, but 5.5 is built with readline.
I have tried with this one:
mysql  Ver 14.14 Distrib 5.5.43, for Linux (x86_64) using readline 5.1

We had the same with Percona Server and after building 5.6 with readline the issue seems gone.

Suggested fix:
Build client with readline or fix the build with editline.
[26 May 2015 7:56] MySQL Verification Team
Hello Tomislav Plavcic,

Thank you for the report.
First issue is easy to repeat with 5.6.24 build but not seeing the second mentioned issue.

Thanks,
Umesh
[26 May 2015 7:57] MySQL Verification Team
// OS, build details

[root@cluster-repo ~]# cat /etc/*release
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Oracle Linux Server release 6.6
Red Hat Enterprise Linux Server release 6.6 (Santiago)
Oracle Linux Server release 6.6

//
[root@cluster-repo ~]# more /usr/share/doc/mysql-community-server-5.6.24/INFO_SRC
commit: 97543660999308893335d81b92307c389e6821a5
date: 2015-03-25 17:22:45 +0100
build-date: 2015-03-25 17:26:48 +0100
short: 9754366
branch: mysql-5.6.24-release

MySQL source 5.6.24

[root@cluster-repo ~]# more /usr/share/doc/mysql-community-server-5.6.24/INFO_BIN|grep -i editline
WITH_EDITLINE:STRING=bundled