[MDEV-18102] CONNECT statement breaks connection and makes client unable to reconnect Created: 2018-12-29  Updated: 2018-12-29  Resolved: 2018-12-29

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 10.3
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Federico Razzoli Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: client


 Description   

CONNECT seems to be undocumented. This is something I ran on a MariaDB client by mistake, but still a crash is always supposed to be a bug.

MariaDB [(none)]> CONNECT a, b;
ERROR 2005 (HY000): Unknown MySQL server host 'b' (-2)
unknown [a,]> SELECT 1;
No connection. Trying to reconnect...
ERROR 2005 (HY000): Unknown MySQL server host 'b' (-2)
ERROR: Can't connect to the server



 Comments   
Comment by Elena Stepanova [ 2018-12-29 ]

CONNECT (in this context) is a client command, not server. It is documented here: https://mariadb.com/kb/en/library/mysql-command-line-client/

connect, \r Reconnect to the server. Optional arguments are db and host.

So, in your case it attempts to reconnect to the db a on the host named b. Naturally, it can't, complains about the unknown host and the session can't work anymore, because it closed the previous connection and couldn't establish the new one. There is no crash, the server itself is okay.

Comment by Federico Razzoli [ 2018-12-29 ]

But my point is about what happens after that. When I run SELECT 1, shouldn't it re-establish the former connection? That's what happens when mysql client loses the connection for any reason.

Generated at Thu Feb 08 08:41:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.