MySQL Forums
Forum List  »  General

Met ERROR 2013 (HY000): Lost connection to MySQL server during query error
Posted by: dclar dclar
Date: July 03, 2019 08:23PM

MysqlVersion:
mysql Ver 14.14 Distrib 5.7.19, for macos10.12 (x86_64) using EditLine wrapper

Problems:

1. Create table
---------------------

CREATE TABLE `t10` (

  `id` int(11) NOT NULL AUTO_INCREMENT,

  `pid` varchar(10) DEFAULT NULL,

  PRIMARY KEY (`id`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8;
---------------------

2. Create annother table:
---------------------
CREATE TABLE `t10_sub` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pid` varchar(10) DEFAULT NULL,
`cid` varchar(10) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
---------------------

3. Execute explain and met the problem:

---------------------
explain (select sub_tmp.cid, (select count(*) from t10 where pid = sub_tmp.pid ) as new_t10 from t10_sub as sub_tmp order by new_t10 + 1) union (select sub_tmp.id,sub_tmp.id from t10_sub as sub_tmp);

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

4. Insert some datas

---------------------
mysql> insert into t10(pid) values('test');

mysql> insert into t10_sub(pid,cid) values('test','test100');
---------------------

5. And ... Met the same problem
---------------------
(select sub_tmp.cid, (select count(*) from t10 where pid = sub_tmp.pid ) as new_t10 from t10_sub as sub_tmp order by new_t10 + 1) union (select sub_tmp.id,sub_tmp.id from t10_sub as sub_tmp);

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

Options: ReplyQuote


Subject
Written By
Posted
Met ERROR 2013 (HY000): Lost connection to MySQL server during query error
July 03, 2019 08:23PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.