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:
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);
......
......@@ -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);
}
/**********************************************************************
......
......@@ -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
......
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