diff options
author | unknown <anozdrin/alik@ibm.> | 2007-07-12 12:49:39 +0400 |
---|---|---|
committer | unknown <anozdrin/alik@ibm.> | 2007-07-12 12:49:39 +0400 |
commit | 6ba23b0ac9a4548de36386b4f892af9c7d471e97 (patch) | |
tree | bad8ca7dc824a2eae76369d7f7183cc94cdf1c9a /sql/sp_head.cc | |
parent | be11de7a8ed93e5dd5d5abd1ca2e9ca5c3922db7 (diff) | |
download | mariadb-git-6ba23b0ac9a4548de36386b4f892af9c7d471e97.tar.gz |
Fix for 5.1 for BUG#10491: Server returns data as charset binary
SHOW CREATE TABLE or SELECT FROM I_S.
This is the last patch for this bug, which depends on the big
CS patch and was pending.
The problem was that SHOW CREATE statements returned original
queries in the binary character set. That could cause the query
to be unreadable.
The fix is to use original character_set_client when sending
the original query to the client. In order to preserve the query
in mysqldump, 'binary' character set results should be set when
issuing SHOW CREATE statement. If either source or destination
character set is 'binary' , no conversion is performed.
The idea is that since the source character set is no longer
'binary', we fix the destination character set to still produce
valid dumps.
client/mysqldump.c:
Switch character_set_results of mysqldump-connection before
calling SHOW CREATE statements for the objects.
mysql-test/r/show_check.result:
Result file.
mysql-test/t/show_check.test:
Add test case for the part of BUG#10491.
sql/events.cc:
Send original query in the original character set.
sql/sp_head.cc:
Send original query in the original character set.
sql/sql_show.cc:
Send original query in the original character set.
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r-- | sql/sp_head.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc index f0cc5204749..d3a9787ee2b 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -2260,7 +2260,8 @@ sp_head::show_create_routine(THD *thd, int type) protocol->store(sql_mode.str, sql_mode.length, system_charset_info); if (full_access) - protocol->store(m_defstr.str, m_defstr.length, &my_charset_bin); + protocol->store(m_defstr.str, m_defstr.length, + m_creation_ctx->get_client_cs()); else protocol->store_null(); |