Originally created by: andreas....@gmail.com
What exact steps will reproduce the problem?
1. create the table in a database "laufkalender" from the attached file
2. open a second session with HeidiSQL and copy the table from there to
another server
3. I have got different errors:
When copying from a remote server to my localhost I have got
Error from remote: SQL error: Lost connection to MySQL server durimg query.
see log below (at the end)
When copying from my localhost to a 3rd remote server I have got
Error from remote: SQL error: Got a packet bigger
than 'max_allowed_packet' bytes.
max_allowed_packet is 1048576 on every server.
Version used?
HeidiSQL revision: 2504
MySQL Server version: v4 and v5
Operating system:
DROP TABLE IF EXISTS `laufkalender`.`news` ;
CREATE TABLE `laufkalender`.`news` ( `id` int(6) unsigned NOT NULL
AUTO_INCREMENT, `status` tinyint(1) unsigned NOT NULL DEFAULT '0',
`country` varchar(3) NOT NULL DEFAULT '', `start_date` date NOT NULL
DEFAULT '2000-01-01', `end_date` date NOT NULL DEFAULT '2099-12-31',
`date` date NOT NULL DEFAULT '0000-00-00', `time` time NOT NULL
DEFAULT '00:00:00', `headline_deu` varchar(200) NOT NULL DEFAULT '',
`headline_fra` varchar(200) NOT NULL DEFAULT '', `headline_ita` varchar
(200) NOT NULL DEFAULT '', `headline_eng` varchar(200) NOT NULL
DEFAULT '', `brief_deu` mediumtext NOT NULL, `brief_fra` mediumtext NOT
NULL, `brief_ita` mediumtext NOT NULL, `brief_eng` mediumtext NOT NULL,
`text_deu` mediumtext NOT NULL, `text_fra` mediumtext NOT NULL,
`text_ita` mediumtext NOT NULL, `text_eng` mediumtext NOT NULL, `hits`
int(10) unsigned NOT NULL DEFAULT '0', `last_spider_visit` date DEFAULT
NULL, PRIMARY KEY (`id`), KEY `date_time` (`date`,`time`) )
ENGINE=MyISAM AUTO_INCREMENT=355 DEFAULT CHARSET=utf8 COMMENT='News-
Archiv' ;
LOCK TABLES `laufkalender`.`news` WRITE ;
ALTER TABLE `laufkalender`.`news` DISABLE KEYS ;
INSERT INTO `laufkalender`.`news` (`id`, `status`, `country`,
`start_date`, `end_date`, `date`, `time`, `headline_deu`, `headline_fra`,
`headline_ita`, `headline_eng`, `brief_deu`, `brief_fra`, `brief_ita`,
`brief_eng`, `text_deu`, `text_fra`, `text_ita`, `text_eng`, `hits`,
`last_spider_visit`) VALUES ('100',1,'','2000-01-01','2099-12-31','2007-
04-10','00:00:00','neue Funktion','neue Funktion','neue Funktion','neue
Funktion','ab sofort können Veranstaltungen bewertet werden','ab sofort
können Veranstaltungen bewertet werden','ab sofort können Veranstaltungen
bewertet werden','ab sofort können Veranstaltungen bewertet werden','Um
den Veranstaltern Feedback geben zu können, haben wir eine Funktion
eingebaut, damit Teilnehmer oder Besucher eine Veranstaltung bewerten
können. Klicken Sie in der Liste der Läufe bei der entsprechenden
Veranstaltung auf das <img border="0" src="/images/comment_add.gif"
alt="">-Symbol, und Sie können Bewertungen abgeben bzw. mit <img
border="0" src="/images/comment_show.gif" alt=""> vorhandene Bewertungen
lesen.\r\nWenn jemand eine gute Veranstaltung organisiert, dann darf man
ihm das mitteilen. Wenn es nicht so optimal geklappt hat, dann muss man
der Organisatoren Gelegenheit geben, das zu verbessern.','Um den
Veranstaltern Feedback geben zu können, haben wir eine Funktion eingebaut,
damit Teilnehmer oder Besucher eine Veranstaltung bewerten können. Klicken
Sie in der Liste der Läufe bei der entsprechenden Veranstaltung auf das
<img border="0" src="/images/comment_add.gif" alt="">-Symbol, und Sie
können Bewertungen abgeben bzw. mit <img border="0"
src="/images/comment_show.gif" alt=""> vorhandene Bewertungen
lesen.\r\nWenn jemand eine gute Veranstaltung organisiert, dann darf man
ihm das mitteilen. Wenn es nicht so optimal geklappt hat, dann muss man
der Organisatoren Gelegenheit geben, das zu verbessern.','Um den
Veranstaltern Feedback geben zu können, haben wir eine Funktion eingebaut,
damit Teilnehmer oder Besucher eine Veranstaltung/* large SQL query,
snipped at 2'000 characters */
/* SQL Error: Lost connection to MySQL server during query */
/* Connection failure detected. Trying to reconnect. */
/* Connected. Thread-ID: 132 */
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: rosenfie...@gmail.com
I see two issues here.
a)
The variable 'max_allowed_packet' is, as far as the vague manual will inform you,
simultaneously used for deciding the length of an internal per-connection buffer in
the server, and for limiting the byte length of accepted SQL queries.
Using the same variable for two completely different things is a classical trademark
in piss-poor design.
Semi-luckily, MySQL protocol messages are hardcoded to at most 16 MiB per message
(because the message length field is an unsigned 24-bit integer), at which point
incoming SQL strings are fragmented into multiple messages. What this means is that
if you set max_allowed_packet to anything larger than 16 MiB, the server just might
"only" use a 16 MiB buffer per connection, which is affordable in RAM, at least on a
64-bit server.
My recommendation would be:
- set max_allowed_packet to the maximum allowed on a test server (manual says 1
GiB),
- start the test server,
- note the memory usage
- connect with 1 client over TCP/IP
- note the memory usage again
Repeat the test with max_allowed_packet set to 16 MiB. If you see the same memory
usage in both scenarios, just leave it at the maximum setting.
Does this fix the problem?
b)
The server fails to give you an error message when it cuts the connection due to an
SQL string that is longer than 'max_allowed_packet'.
This probably happens because of a bug in the server or client networking code.
On the server side, the server may never send an error message, instead just cutting
the connection abruptly.
In the theoretical situation that the server behaved correctly and sent an error
message, the client would have to behave correctly too. In the event that it
discovers that the TCP connection is no longer alive, it would still have to read
the remaining messages off of the network stream before it aborts, and abort with
the error message sent by the server rather than what you see above.
If you want to report item b) as a bug to MySQL, you can find out which is broken,
client or server, by using Wireshark to capture packets while this happens. You
want to look for MySQL protocol message with a type of ERROR right before the
connection dies. If the error message is there, the server works but the client
that HeidiSQL uses (libmysql.dll, provided by MySQL) is broken. If the error
message is not there, the server is broken.
And a final note:
In theory, HeidiSQL could work around this issue by reading the SQL, recognizing the
extended insert syntax, and splitting it into multiple queries depending on what the
max_allowed_packet is for the destination server.
Similarly, HeidiSQL could recognize non-extended insert syntax and convert to the
(due to another protocol design flaw) much faster extended insert syntax on-the-fly.
Is it worth it to start working around considerable MySQL problems in a client like
HeidiSQL? In theory no, a fix by MySQL would fix things for many more clients. In
practice, political issues may make a workaround in HeidiSQL easier to accomplish in
a given timeframe. For now, I'm marking this issue as Upstream; but if you want I
can change it to a feature request.
Status: Upstream