simple query makes the connection to close

Bug #1598627 reported by marki555
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Server moved to https://jira.percona.com/projects/PS
New
Undecided
Unassigned

Bug Description

I have Percona server on debian jessie: 5.7.12-5-log Percona Server (GPL), Release '5', Revision 'a2f663a'

Sending this simple query ends up with empty result ("Empty set (0.00 sec)"), but with lost connection to server:
"SELECT login, password, "", uid, gid, homedir, maildir, "", "", CONCAT("mailhost=",server) FROM email_users WHERE login = 'markionline' AND (status=1);"

I have verified that the query does not contain any strange characters (no char higher than 0x77). Modifying the query in any way (replacing 2 spaces before "AND" with only one; or changing the case of SELECT to SELECt) does not trigger the lost connection.

In error log, there is line:
"[Note] Aborted connection 120 to db: 'xx' user: 'root' host: 'xx.xx.244.188' (Got an error reading communication packets)"
or
"[Note] Aborted connection 100 to db: 'xx' user: 'root' host: 'localhost' (Got an error writing communication packets)"
depending on whether I am connected via socket or TCP. Strange that it is "reading" on one line and then "writing".

I tried several versions of mysql commandline. I have noticed that the connection is lost when the connection charset is set to "latin1" when connecting with mysql 5.7 clients. Changing connection charset to utf8 fixes it. However using mysql 5.6 client, it works even with "latin1" connection charset.

Here is the table:

CREATE TABLE `email_users` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `login` varchar(50) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '0',
  `email` varchar(128) NOT NULL DEFAULT '0',
  `password` varchar(100) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `client_id` int(11) NOT NULL DEFAULT '0',
  `domain_id` int(11) DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `uid` int(11) unsigned NOT NULL DEFAULT '3111',
  `gid` int(11) unsigned NOT NULL DEFAULT '3111',
  `server` varchar(125) DEFAULT 'server',
  `homedir` tinytext,
  `maildir` tinytext,
  `quota` varchar(255) DEFAULT NULL,
  `size` int(11) DEFAULT '0',
  `status` char(1) NOT NULL DEFAULT '1',
  `autoreply` char(1) NOT NULL DEFAULT '0',
  `create_date` date NOT NULL DEFAULT '0000-00-00',
  `change_date` date NOT NULL DEFAULT '0000-00-00',
  PRIMARY KEY (`id`),
  UNIQUE KEY `login` (`login`),
  UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=80480 DEFAULT CHARSET=utf8

Revision history for this message
marki555 (marki-g) wrote :

I have now tried connecting to the same db/table on mysqld 5.6 server and it works all the time. Both using 5.6 and 5.7 clients. However I noticed the difference between my 5.6 and 5.7 server. Server 5.6 has configured character_set_server to utf8, but my 5.7 server doesn't and uses default value of latin1.

Looks like the default my.cnf for debian jessie package from percona repo does not configure it and I probably forgot to set it to utf8. Does it make any harm having table in utf8 charset with character_set_server set to latin1?

Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PS-3478

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.