diff --git a/dict/dict0dict.c b/dict/dict0dict.c index 563b5c371a8..8b127ed7ecd 100644 --- a/dict/dict0dict.c +++ b/dict/dict0dict.c @@ -2541,7 +2541,7 @@ convert_id: len = 3 * len + 1; *id = dst = mem_heap_alloc(heap, len); - innobase_convert_from_id(dst, str, len); + innobase_convert_from_id(cs, dst, str, len); } else if (!strncmp(str, srv_mysql50_table_name_prefix, sizeof srv_mysql50_table_name_prefix)) { /* This is a pre-5.1 table name @@ -2555,7 +2555,7 @@ convert_id: len = 5 * len + 1; *id = dst = mem_heap_alloc(heap, len); - innobase_convert_from_table_id(dst, str, len); + innobase_convert_from_table_id(cs, dst, str, len); } return(ptr); diff --git a/handler/ha_innodb.cc b/handler/ha_innodb.cc index 439ee110cab..0e5a3a5b411 100644 --- a/handler/ha_innodb.cc +++ b/handler/ha_innodb.cc @@ -910,14 +910,14 @@ extern "C" UNIV_INTERN void innobase_convert_from_table_id( /*===========================*/ - char* to, /* out: converted identifier */ - const char* from, /* in: identifier to convert */ - ulint len) /* in: length of 'to', in bytes */ + struct charset_info_st* cs, /* in: the 'from' character set */ + char* to, /* out: converted identifier */ + const char* from, /* in: identifier to convert */ + ulint len) /* in: length of 'to', in bytes */ { uint errors; - strconvert(thd_charset(current_thd), from, - &my_charset_filename, to, (uint) len, &errors); + strconvert(cs, from, &my_charset_filename, to, (uint) len, &errors); } /********************************************************************** @@ -926,14 +926,14 @@ extern "C" UNIV_INTERN void innobase_convert_from_id( /*=====================*/ - char* to, /* out: converted identifier */ - const char* from, /* in: identifier to convert */ - ulint len) /* in: length of 'to', in bytes */ + struct charset_info_st* cs, /* in: the 'from' character set */ + char* to, /* out: converted identifier */ + const char* from, /* in: identifier to convert */ + ulint len) /* in: length of 'to', in bytes */ { uint errors; - strconvert(thd_charset(current_thd), from, - system_charset_info, to, (uint) len, &errors); + strconvert(cs, from, system_charset_info, to, (uint) len, &errors); } /********************************************************************** diff --git a/include/ha_prototypes.h b/include/ha_prototypes.h index 84874bce30b..e6a33f3f2d1 100644 --- a/include/ha_prototypes.h +++ b/include/ha_prototypes.h @@ -174,20 +174,22 @@ UNIV_INTERN void innobase_convert_from_table_id( /*===========================*/ - char* to, /* out: converted identifier */ - const char* from, /* in: identifier to convert */ - ulint len); /* in: length of 'to', in bytes; should - be at least 5 * strlen(to) + 1 */ + struct charset_info_st* cs, /* in: the 'from' character set */ + char* to, /* out: converted identifier */ + const char* from, /* in: identifier to convert */ + ulint len); /* in: length of 'to', in bytes; should + be at least 5 * strlen(to) + 1 */ /********************************************************************** Converts an identifier to UTF-8. */ UNIV_INTERN void innobase_convert_from_id( /*=====================*/ - char* to, /* out: converted identifier */ - const char* from, /* in: identifier to convert */ - ulint len); /* in: length of 'to', in bytes; should - be at least 3 * strlen(to) + 1 */ + struct charset_info_st* cs, /* in: the 'from' character set */ + char* to, /* out: converted identifier */ + const char* from, /* in: identifier to convert */ + ulint len); /* in: length of 'to', in bytes; should + be at least 3 * strlen(to) + 1 */ /********************************************************************** Makes all characters in a NUL-terminated UTF-8 string lower case. */ UNIV_INTERN