Bug #74534 The server wil lost connection after the query "select \N\r"
Submitted: 24 Oct 2014 3:31 Modified: 25 Nov 2014 6:48
Reporter: qiaohongyu qiaohongyu Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version:MySQL-5.6.20 OS:Linux (Ubuntu 12.04)
Assigned to: CPU Architecture:Any
Tags: Lost connection, select \N\r

[24 Oct 2014 3:31] qiaohongyu qiaohongyu
Description:
you can execute the query like below. you can use any table instead test.t3.

mysql> select * from t3;
+------+
| c1   |
+------+
|    1 |
|    2 |
|   -1 |
|   -2 |
+------+
4 rows in set (0.00 sec)

mysql> select \N\r;
ERROR 1049 (42000): Unknown database ';'
mysql> select * from t3;
No connection. Trying to reconnect...
ERROR 1049 (42000): Unknown database ';'
ERROR: 
Can't connect to the server

mysql> show tables;
No connection. Trying to reconnect...
ERROR 1049 (42000): Unknown database ';'
ERROR: 
Can't connect to the server

mysql> use test;
No connection. Trying to reconnect...
Connection id:    82
Current database: *** NONE ***

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> select * from t3;
+------+
| c1   |
+------+
|    1 |
|    2 |
|   -1 |
|   -2 |
+------+
4 rows in set (0.00 sec)

How to repeat:
whenever you execute the query "select \N\r;",it will hanppend

Suggested fix:
Do not support it in the parser.
[24 Oct 2014 6:16] MySQL Verification Team
This is not a server bug, and I doubt it is a client bug either.

What you're telling the client to do is reconnect and change the current database.
That is was \r;  tries to do.

List of all MySQL commands:
Note that all text commands must be first on line and end with ';'
?         (\?) Synonym for `help'.
clear     (\c) Clear the current input statement.
connect   (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter.
ego       (\G) Send command to mysql server, display result vertically.
exit      (\q) Exit mysql. Same as quit.
go        (\g) Send command to mysql server.
help      (\h) Display this help.
notee     (\t) Don't write into outfile.
print     (\p) Print current command.
prompt    (\R) Change your mysql prompt.
quit      (\q) Quit mysql.
rehash    (\#) Rebuild completion hash.
source    (\.) Execute an SQL script file. Takes a file name as an argument.
status    (\s) Get status information from the server.
tee       (\T) Set outfile [to_outfile]. Append everything into given outfile.
use       (\u) Use another database. Takes database name as argument.
charset   (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets.
warnings  (\W) Show warnings after every statement.
nowarning (\w) Don't show warnings after every statement.
resetconnection(\x) Clean session context.
[25 Nov 2014 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".