summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2014-09-12 16:06:18 +0400
committerAlexander Barkov <bar@mariadb.org>2014-09-12 16:06:18 +0400
commitb23af8566210df071101470dd5266255216dde87 (patch)
tree8f549171909e70cdb74a7d2faeb9267c769192da /sql/sql_show.cc
parentfa51a22388135007bd6dff0ffa42ba3d90debd91 (diff)
downloadmariadb-git-b23af8566210df071101470dd5266255216dde87.tar.gz
MDEV-6737 Stored routines do now work with swe7: "The table mysql.proc is missing, corrupt, or contains bad data"
Fixed the bug itself. Also, added "SET NAMES swe7" which was forgotten in the previous commit, so latin1 was actually tested lati1 instead of swe7 in a mistake. Now it tests swe7.
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc19
1 files changed, 16 insertions, 3 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index b2cfab1b768..87cec1ce2ae 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1321,9 +1321,22 @@ append_identifier(THD *thd, String *packet, const char *name, uint length)
it's a keyword
*/
+ /*
+ Special code for swe7. It encodes the letter "E WITH ACUTE" on
+ the position 0x60, where backtick normally resides.
+ In swe7 we cannot append 0x60 using system_charset_info,
+ because it cannot be converted to swe7 and will be replaced to
+ question mark '?'. Use &my_charset_bin to avoid this.
+ It will prevent conversion and will append the backtick as is.
+ */
+ CHARSET_INFO *quote_charset= q == 0x60 &&
+ (packet->charset()->state & MY_CS_NONASCII) &&
+ packet->charset()->mbmaxlen == 1 ?
+ &my_charset_bin : system_charset_info;
+
(void) packet->reserve(length*2 + 2);
quote_char= (char) q;
- if (packet->append(&quote_char, 1, system_charset_info))
+ if (packet->append(&quote_char, 1, quote_charset))
return true;
for (name_end= name+length ; name < name_end ; name+= length)
@@ -1340,12 +1353,12 @@ append_identifier(THD *thd, String *packet, const char *name, uint length)
if (!length)
length= 1;
if (length == 1 && chr == (uchar) quote_char &&
- packet->append(&quote_char, 1, system_charset_info))
+ packet->append(&quote_char, 1, quote_charset))
return true;
if (packet->append(name, length, system_charset_info))
return true;
}
- return packet->append(&quote_char, 1, system_charset_info);
+ return packet->append(&quote_char, 1, quote_charset);
}