diff options
author | unknown <elliot@mysql.com> | 2005-08-19 14:49:34 -0400 |
---|---|---|
committer | unknown <elliot@mysql.com> | 2005-08-19 14:49:34 -0400 |
commit | 1b970e94e0a736a2056cb94cfcba0b50133da1d6 (patch) | |
tree | e9b004d2e9d0b322b3e2006b7e0e0733ea5d65f9 /sql/item.cc | |
parent | 496e86da3a2b0019a3d9c186063e2c4f56b2bb44 (diff) | |
download | mariadb-git-1b970e94e0a736a2056cb94cfcba0b50133da1d6.tar.gz |
Bug#11338 Fixes from review (identical functionality).
include/my_sys.h:
Fixes from review (use version in log_event.cc instead)
mysql-test/r/ctype_cp932.result:
Updated test for bug#11338 (logging of prepared statement w/ blob type)
mysql-test/t/ctype_cp932.test:
udpated test for bug#11338 (logging of prepared statement w/ blob type)
mysys/charset.c:
Fixes from review (use version in log_event.cc instead)
sql/item.cc:
Fixes from review (store character_set_client differently so that
fix can be merged forward to 5.0)
sql/item.h:
Fixes from review
sql/log_event.cc:
Fixes from review, str_to_hex is now used by item.cc
sql/log_event.h:
Added prototype for str_to_hex (now used by item.cc)
sql/sql_prepare.cc:
Fixes from review, store character_set_client differently so that
Item_param::query_val_str can use it.
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sql/item.cc b/sql/item.cc index 79579eeeb67..2ae56d17b07 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -1230,7 +1230,7 @@ bool Item_param::set_from_user_var(THD *thd, const user_var_entry *entry) CHARSET_INFO *tocs= thd->variables.collation_connection; uint32 dummy_offset; - value.cs_info.character_set_client= fromcs; + value.cs_info.character_set_of_placeholder= fromcs; /* Setup source and destination character sets so that they are different only if conversion is necessary: this will @@ -1443,7 +1443,7 @@ String *Item_param::val_str(String* str) and avoid one more memcpy/alloc between str and log string. */ -const String *Item_param::query_val_str(String* str, THD *thd) const +const String *Item_param::query_val_str(String* str) const { switch (state) { case INT_VALUE: @@ -1482,18 +1482,17 @@ const String *Item_param::query_val_str(String* str, THD *thd) const buf= str->c_ptr_quick(); ptr= buf; - if (thd->charset()->escape_with_backslash_is_dangerous) + if (value.cs_info.character_set_client->escape_with_backslash_is_dangerous) { - ptr= strmov(ptr, "x\'"); - ptr= bare_str_to_hex(ptr, str_value.ptr(), str_value.length()); + ptr= str_to_hex(ptr, str_value.ptr(), str_value.length()); } else { *ptr++= '\''; ptr+= escape_string_for_mysql(str_value.charset(), ptr, str_value.ptr(), str_value.length()); + *ptr++='\''; } - *ptr++='\''; str->length(ptr - buf); break; } @@ -1523,10 +1522,10 @@ bool Item_param::convert_str_value(THD *thd) here only if conversion is really necessary. */ if (value.cs_info.final_character_set_of_str_value != - value.cs_info.character_set_client) + value.cs_info.character_set_of_placeholder) { rc= thd->convert_string(&str_value, - value.cs_info.character_set_client, + value.cs_info.character_set_of_placeholder, value.cs_info.final_character_set_of_str_value); } else |