summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorbar@mysql.com <>2004-12-02 11:39:50 +0400
committerbar@mysql.com <>2004-12-02 11:39:50 +0400
commit015b6f4136a76b66275314f50af64954e9558874 (patch)
treeef7f49d5f87086860f56613a55046bec3f5847ec /sql/sql_show.cc
parent227ffeb9e097121ac82e65e9dd8b8dd1a73601a8 (diff)
downloadmariadb-git-015b6f4136a76b66275314f50af64954e9558874.tar.gz
Bug #6815 SHOW CREATE TABLE hangs after upgrading to 4.1
A test doesn't seem to be possible.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index bda490e2916..ff0d943a717 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1169,6 +1169,15 @@ append_identifier(THD *thd, String *packet, const char *name, uint length)
{
uchar chr= (uchar) *name;
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)
packet->append(&quote_char, 1, system_charset_info);
packet->append(name, length, packet->charset());