I have MySQL 5.5.20 and this table:
mysql> desc country; +----------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------------+-------------+------+-----+---------+-------+ | id | int(255) | NO | PRI | NULL | | | iso | varchar(2) | NO | | NULL | | | name | varchar(80) | NO | | NULL | | | printable_name | varchar(80) | NO | | NULL | | | iso3 | varchar(3) | YES | | NULL | | | numcode | smallint(6) | YES | | NULL | | +----------------+-------------+------+-----+---------+-------+
If I run a query like this
SELECT country.ID, country.ISO, country.NAME,
country.PRINTABLE_NAME, country.ISO3, country.NUMCODE
FROM country;
It returns:
ERROR 2013 (HY000): Lost connection to MySQL server during query
If I change the order of the columns (ISO3 before PRINTABLE_NAME for example) like this:
SELECT country.ID, country.ISO, country.NAME,
country.PRINTABLE_NAME, country.NUMCODE, country.ISO3
FROM country;
It works fine!
Or if I rewrite the query using lower-case letters for columns, it works as well.
This issue appears from time to time (about once a month) and the only solution to fix it is to restart MySQL! i have checked error log and nothing added to error log upon this error!! I am really confused and don't know why this happens! Any ideas on how this could be fixed?