Commit 015b6f41 authored by bar@mysql.com's avatar bar@mysql.com

Bug #6815 SHOW CREATE TABLE hangs after upgrading to 4.1

A test doesn't seem to be possible.
parent 227ffeb9
...@@ -1169,6 +1169,15 @@ append_identifier(THD *thd, String *packet, const char *name, uint length) ...@@ -1169,6 +1169,15 @@ append_identifier(THD *thd, String *packet, const char *name, uint length)
{ {
uchar chr= (uchar) *name; uchar chr= (uchar) *name;
length= my_mbcharlen(system_charset_info, chr); length= my_mbcharlen(system_charset_info, chr);
/*
my_mbcharlen can retur 0 on a wrong multibyte
sequence. It is possible when upgrading from 4.0,
and identifier contains some accented characters.
The manual says it does not work. So we'll just
change length to 1 not to hang in the endless loop.
*/
if (!length)
length= 1;
if (length == 1 && chr == (uchar) quote_char) if (length == 1 && chr == (uchar) quote_char)
packet->append(&quote_char, 1, system_charset_info); packet->append(&quote_char, 1, system_charset_info);
packet->append(name, length, packet->charset()); packet->append(name, length, packet->charset());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment