diff options
author | bar@mysql.com/bar.intranet.mysql.r18.ru <> | 2006-11-16 13:44:23 +0400 |
---|---|---|
committer | bar@mysql.com/bar.intranet.mysql.r18.ru <> | 2006-11-16 13:44:23 +0400 |
commit | 9543b7dfba941181d948305bdf82a70d84b9113d (patch) | |
tree | 0ce97c69c095f49c2f39f1427c7fc9c160f8c0bb | |
parent | 021d85f032fbb515992df4b4085c2b6e9db0eab3 (diff) | |
parent | d3603eb152aa9498791ddf4b8d1452afc0904926 (diff) | |
download | mariadb-git-9543b7dfba941181d948305bdf82a70d84b9113d.tar.gz |
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into mysql.com:/usr/home/bar/mysql-5.0.b23619
-rw-r--r-- | mysql-test/r/ctype_cp932_binlog.result | 6 | ||||
-rw-r--r-- | mysql-test/r/rpl_charset_sjis.result | 26 | ||||
-rw-r--r-- | mysql-test/t/rpl_charset_sjis.test | 25 | ||||
-rw-r--r-- | sql/log_event.cc | 2 | ||||
-rw-r--r-- | sql/sp_head.cc | 11 |
5 files changed, 61 insertions, 9 deletions
diff --git a/mysql-test/r/ctype_cp932_binlog.result b/mysql-test/r/ctype_cp932_binlog.result index 6d742f3d464..d3d800b7bf0 100644 --- a/mysql-test/r/ctype_cp932_binlog.result +++ b/mysql-test/r/ctype_cp932_binlog.result @@ -41,6 +41,6 @@ IN ind DECIMAL(10,2)) BEGIN INSERT INTO t4 VALUES (ins1, ins2, ind); END -master-bin.000001 801 Query 1 1006 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1'Foo\'s a Bar'), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93)) -master-bin.000001 1006 Query 1 1092 use `test`; DROP PROCEDURE bug18293 -master-bin.000001 1092 Query 1 1168 use `test`; DROP TABLE t4 +master-bin.000001 801 Query 1 1017 use `test`; INSERT INTO t4 VALUES ( NAME_CONST('ins1',_latin1 0x466F6F2773206120426172), NAME_CONST('ins2',_cp932 0xED40ED41ED42), NAME_CONST('ind',47.93)) +master-bin.000001 1017 Query 1 1103 use `test`; DROP PROCEDURE bug18293 +master-bin.000001 1103 Query 1 1179 use `test`; DROP TABLE t4 diff --git a/mysql-test/r/rpl_charset_sjis.result b/mysql-test/r/rpl_charset_sjis.result new file mode 100644 index 00000000000..770ad0588d1 --- /dev/null +++ b/mysql-test/r/rpl_charset_sjis.result @@ -0,0 +1,26 @@ +stop slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +reset master; +reset slave; +drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; +start slave; +drop table if exists t1; +drop procedure if exists p1; +create table t1 (a varchar(255) character set sjis); +create procedure p1 (in a varchar(255) character set sjis) insert into t1 values (a); +SET NAMES binary; +CALL p1 ('–\\'); +select "--- on master ---"; +--- on master --- +--- on master --- +select hex(a) from t1 ; +hex(a) +965C +select "--- on slave ---"; +--- on slave --- +--- on slave --- +select hex(a) from t1; +hex(a) +965C +drop table t1; +drop procedure p1; diff --git a/mysql-test/t/rpl_charset_sjis.test b/mysql-test/t/rpl_charset_sjis.test new file mode 100644 index 00000000000..2469b0db8a2 --- /dev/null +++ b/mysql-test/t/rpl_charset_sjis.test @@ -0,0 +1,25 @@ +source include/have_sjis.inc; +source include/master-slave.inc; + +--disable_warnings +drop table if exists t1; +drop procedure if exists p1; +--enable_warnings +create table t1 (a varchar(255) character set sjis); +create procedure p1 (in a varchar(255) character set sjis) insert into t1 values (a); + +SET NAMES binary; +CALL p1 ('–\\'); +select "--- on master ---"; +select hex(a) from t1 ; +sync_slave_with_master; +connection slave; +select "--- on slave ---"; +select hex(a) from t1; +connection master; +drop table t1; +drop procedure p1; +sync_slave_with_master; +connection master; + +# End of 5.0 tests diff --git a/sql/log_event.cc b/sql/log_event.cc index 2ad52945c9e..30490f75c0f 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -261,7 +261,7 @@ append_query_string(CHARSET_INFO *csinfo, else { *ptr++= '\''; - ptr+= escape_string_for_mysql(from->charset(), ptr, 0, + ptr+= escape_string_for_mysql(csinfo, ptr, 0, from->ptr(), from->length()); *ptr++='\''; } diff --git a/sql/sp_head.cc b/sql/sp_head.cc index a06bfe28a6f..88f9d4dece4 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -93,7 +93,7 @@ sp_map_item_type(enum enum_field_types type) */ static String * -sp_get_item_value(Item *item, String *str) +sp_get_item_value(THD *thd, Item *item, String *str) { Item_result result_type= item->result_type(); @@ -113,15 +113,16 @@ sp_get_item_value(Item *item, String *str) { char buf_holder[STRING_BUFFER_USUAL_SIZE]; String buf(buf_holder, sizeof(buf_holder), result->charset()); + CHARSET_INFO *cs= thd->variables.character_set_client; /* We must reset length of the buffer, because of String specificity. */ buf.length(0); buf.append('_'); buf.append(result->charset()->csname); - if (result->charset()->escape_with_backslash_is_dangerous) + if (cs->escape_with_backslash_is_dangerous) buf.append(' '); - append_query_string(result->charset(), result, &buf); + append_query_string(cs, result, &buf); str->copy(buf); return str; @@ -862,7 +863,7 @@ subst_spvars(THD *thd, sp_instr *instr, LEX_STRING *query_str) val= (*splocal)->this_item(); DBUG_PRINT("info", ("print %p", val)); - str_value= sp_get_item_value(val, &str_value_holder); + str_value= sp_get_item_value(thd, val, &str_value_holder); if (str_value) res|= qbuf.append(*str_value); else @@ -1456,7 +1457,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount, if (arg_no) binlog_buf.append(','); - str_value= sp_get_item_value(nctx->get_item(arg_no), + str_value= sp_get_item_value(thd, nctx->get_item(arg_no), &str_value_holder); if (str_value) |