Skip to content

bug: Query doesn't support mysql reconnect correctly #4430

@Xuanwo

Description

@Xuanwo

Search before asking

  • I had searched in the issues and found no similar issues.

Version

databend-query built with 07b14ceacef62eb8b5fba1fb8a74abcaee4db0dc

What's Wrong?

:( mysql -uroot -h127.0.0.1 -P3307 -A
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.26-0.1.0-e661ee7-simd(1.61.0-nightly-2022-03-13T11:45:52.777998283+00:00) 0

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MySQL [(none)]> use db;
Database changed
MySQL [db]> select count(*) from t;
+---------+
| count() |
+---------+
|    9705 |
+---------+
1 row in set (6.910 sec)

<-- Shutdown query and restart;

MySQL [db]> select count(*) from t;
ERROR 2013 (HY000): Lost connection to server during query
MySQL [db]> select count(*) from t;
ERROR 2006 (HY000): Server has gone away
No connection. Trying to reconnect...
Connection id:    8
Current database: db

ERROR 1105 (HY000): Code: 1025, displayText = Unknown table: 't'.
MySQL [db]>

MySQL sends Current database: db but databend seems don't respect it. We need to use db; again to go further.

What You Expected?

mysql client can reconnect without use db; again.

How to Reproduce?

  • Start databend-query
  • Use mysql client to connect query
  • Shutdown and restart query
  • MySQL client should reconnect successfully

Anything Else?

None

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Metadata

Metadata

Assignees

Labels

C-bugCategory: something isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions