diff options
author | unknown <aelkin@mysql.com> | 2006-02-10 15:12:27 +0200 |
---|---|---|
committer | unknown <aelkin@mysql.com> | 2006-02-10 15:12:27 +0200 |
commit | a68f171585da08a855df1958caab3264a4b74006 (patch) | |
tree | 2acf7c5461c6438f1824325abedf22ed98152c69 /sql/log_event.cc | |
parent | 1a27a433fc6e3eb50b995cd52c11edcb2364d362 (diff) | |
download | mariadb-git-a68f171585da08a855df1958caab3264a4b74006.tar.gz |
BUG#16217 fix partly backported from 5.0. It is different in mysqlbinlog part.
This changeset is assumed to stay in 4.1.
client/mysql.cc:
BUG#16217 forced to introduce a separate mysql client command.
Feature is backported from 5.0, precisely
ChangeSet 1.2034 06/02/09 16:23:09 aelkin@mysql.com
(under second review at the moment)
mysql-test/r/mysqlbinlog.result:
changed in 5.0
mysql-test/t/mysqlbinlog.test:
backported from 5.0. The last part of the test to mimic bug#16217
sql/log_event.cc:
Inserting exclaiming comment command for mysql client made differently than in 5.0.
Parsing still is cheap enough not to think to modify server code instead.
Diffstat (limited to 'sql/log_event.cc')
-rw-r--r-- | sql/log_event.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/log_event.cc b/sql/log_event.cc index 3f545df5776..19c32b2d28e 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -949,6 +949,7 @@ Query_log_event::Query_log_event(const char* buf, int event_len, void Query_log_event::print(FILE* file, bool short_form, char* last_db) { char buff[40],*end; // Enough for SET TIMESTAMP + const uint set_len= sizeof("SET ONE_SHOT CHARACTER_SET_CLIENT=") - 1; if (!short_form) { print_header(file); @@ -978,6 +979,17 @@ void Query_log_event::print(FILE* file, bool short_form, char* last_db) my_fwrite(file, (byte*) buff, (uint) (end-buff),MYF(MY_NABP | MY_WME)); if (flags & LOG_EVENT_THREAD_SPECIFIC_F) fprintf(file,"SET @@session.pseudo_thread_id=%lu;\n",(ulong)thread_id); + /* charset_name command for mysql client */ + if (!strncmp(query, "SET ONE_SHOT CHARACTER_SET_CLIENT=", set_len)) + { + char * endptr; + int cs_number= strtoul(query + set_len, &endptr, 10); + DBUG_ASSERT(*endptr == ','); + CHARSET_INFO *cs_info= get_charset(cs_number, MYF(MY_WME)); + if (cs_info) { + fprintf(file, "/*!\\C %s */;\n", cs_info->csname); + } + } my_fwrite(file, (byte*) query, q_len, MYF(MY_NABP | MY_WME)); fprintf(file, ";\n"); } |