Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mycat show tables导致 Lost connection to MySQL server during query #1154

Closed
ZzzCrazyPig opened this issue Oct 17, 2016 · 2 comments
Closed

Comments

@ZzzCrazyPig
Copy link
Contributor

ZzzCrazyPig commented Oct 17, 2016

mycat版本1.5和1.6 发现

mycat show tables引发 ERROR 2013 (HY000): Lost connection to MySQL server during query

BUG复现:

(1). 使用mysql命令行登录mycat

(2). 直接执行show tables;

这个时候返回响应

ERROR 1046 (HY000): No database selected

到这里看似是正常的!

(3). 执行use [database]

(4). 再执行show tables,响应错误

ERROR 2013 (HY000): Lost connection to MySQL server during query

错误定位在ShowTables类的response方法:

if(schema != null) {
            //不分库的schema,show tables从后端 mysql中查
            String node = schema.getDataNode();
            if(!Strings.isNullOrEmpty(node)) {
                c.execute(stmt, ServerParse.SHOW);
                return;
            }
        } else {
             c.writeErrMessage(ErrorCode.ER_NO_DB_ERROR,"No database selected");
        }

else分支写err信息到前端连接后应该return

@magicdoom
Copy link
Contributor

提交个pr吧

@cheungfeifu
Copy link

我怀疑他们的异常处理是怎么搞的,所有的异常都能报错:Lost connection to MySQL server during query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants