Commit 39147158 authored by marko's avatar marko

branches/zip: innobase_convert_from_id(), innobase_convert_from_table_id():

Add the parameter struct charset_info_st* cs, so that the call
thd_charset(current_thd) can be avoided.  The macro current_thd has no
defined value in the Windows plugin.
parent dc32dbdb
...@@ -2541,7 +2541,7 @@ convert_id: ...@@ -2541,7 +2541,7 @@ convert_id:
len = 3 * len + 1; len = 3 * len + 1;
*id = dst = mem_heap_alloc(heap, len); *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, } else if (!strncmp(str, srv_mysql50_table_name_prefix,
sizeof srv_mysql50_table_name_prefix)) { sizeof srv_mysql50_table_name_prefix)) {
/* This is a pre-5.1 table name /* This is a pre-5.1 table name
...@@ -2555,7 +2555,7 @@ convert_id: ...@@ -2555,7 +2555,7 @@ convert_id:
len = 5 * len + 1; len = 5 * len + 1;
*id = dst = mem_heap_alloc(heap, len); *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); return(ptr);
......
...@@ -910,14 +910,14 @@ extern "C" UNIV_INTERN ...@@ -910,14 +910,14 @@ extern "C" UNIV_INTERN
void void
innobase_convert_from_table_id( innobase_convert_from_table_id(
/*===========================*/ /*===========================*/
char* to, /* out: converted identifier */ struct charset_info_st* cs, /* in: the 'from' character set */
const char* from, /* in: identifier to convert */ char* to, /* out: converted identifier */
ulint len) /* in: length of 'to', in bytes */ const char* from, /* in: identifier to convert */
ulint len) /* in: length of 'to', in bytes */
{ {
uint errors; uint errors;
strconvert(thd_charset(current_thd), from, strconvert(cs, from, &my_charset_filename, to, (uint) len, &errors);
&my_charset_filename, to, (uint) len, &errors);
} }
/********************************************************************** /**********************************************************************
...@@ -926,14 +926,14 @@ extern "C" UNIV_INTERN ...@@ -926,14 +926,14 @@ extern "C" UNIV_INTERN
void void
innobase_convert_from_id( innobase_convert_from_id(
/*=====================*/ /*=====================*/
char* to, /* out: converted identifier */ struct charset_info_st* cs, /* in: the 'from' character set */
const char* from, /* in: identifier to convert */ char* to, /* out: converted identifier */
ulint len) /* in: length of 'to', in bytes */ const char* from, /* in: identifier to convert */
ulint len) /* in: length of 'to', in bytes */
{ {
uint errors; uint errors;
strconvert(thd_charset(current_thd), from, strconvert(cs, from, system_charset_info, to, (uint) len, &errors);
system_charset_info, to, (uint) len, &errors);
} }
/********************************************************************** /**********************************************************************
......
...@@ -174,20 +174,22 @@ UNIV_INTERN ...@@ -174,20 +174,22 @@ UNIV_INTERN
void void
innobase_convert_from_table_id( innobase_convert_from_table_id(
/*===========================*/ /*===========================*/
char* to, /* out: converted identifier */ struct charset_info_st* cs, /* in: the 'from' character set */
const char* from, /* in: identifier to convert */ char* to, /* out: converted identifier */
ulint len); /* in: length of 'to', in bytes; should const char* from, /* in: identifier to convert */
be at least 5 * strlen(to) + 1 */ ulint len); /* in: length of 'to', in bytes; should
be at least 5 * strlen(to) + 1 */
/********************************************************************** /**********************************************************************
Converts an identifier to UTF-8. */ Converts an identifier to UTF-8. */
UNIV_INTERN UNIV_INTERN
void void
innobase_convert_from_id( innobase_convert_from_id(
/*=====================*/ /*=====================*/
char* to, /* out: converted identifier */ struct charset_info_st* cs, /* in: the 'from' character set */
const char* from, /* in: identifier to convert */ char* to, /* out: converted identifier */
ulint len); /* in: length of 'to', in bytes; should const char* from, /* in: identifier to convert */
be at least 3 * strlen(to) + 1 */ 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. */ Makes all characters in a NUL-terminated UTF-8 string lower case. */
UNIV_INTERN UNIV_INTERN
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment