mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixed issues with partitions and create temporary table SELECT ...
Merged all ddl_logging code. Merged sql_partition.cc innodb_mysql_lock2.test and partition_cache.test now works. Changed interface to strconvert() to make it easier to use with not \0 terminated strings. sql/sql_partition.cc: Full merge with 5.6 sql/sql_table.cc: Merged all ddl_logging code sql/strfunc.cc: Added from_length argument to strconvert() to make it possible to use without end terminated strings. sql/strfunc.h: Added from_length argument to strconvert() to make it possible to use without end terminated strings.
This commit is contained in:
@ -265,27 +265,22 @@ uint check_word(TYPELIB *lib, const char *val, const char *end,
|
||||
*/
|
||||
|
||||
|
||||
uint strconvert(CHARSET_INFO *from_cs, const char *from,
|
||||
uint strconvert(CHARSET_INFO *from_cs, const char *from, uint from_length,
|
||||
CHARSET_INFO *to_cs, char *to, uint to_length, uint *errors)
|
||||
{
|
||||
int cnvres;
|
||||
my_wc_t wc;
|
||||
char *to_start= to;
|
||||
uchar *to_end= (uchar*) to + to_length - 1;
|
||||
const uchar *from_end= (const uchar*) from + from_length;
|
||||
my_charset_conv_mb_wc mb_wc= from_cs->cset->mb_wc;
|
||||
my_charset_conv_wc_mb wc_mb= to_cs->cset->wc_mb;
|
||||
uint error_count= 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
/*
|
||||
Using 'from + 10' is safe:
|
||||
- it is enough to scan a single character in any character set.
|
||||
- if remaining string is shorter than 10, then mb_wc will return
|
||||
with error because of unexpected '\0' character.
|
||||
*/
|
||||
if ((cnvres= (*mb_wc)(from_cs, &wc,
|
||||
(uchar*) from, (uchar*) from + 10)) > 0)
|
||||
(uchar*) from, from_end)) > 0)
|
||||
{
|
||||
if (!wc)
|
||||
break;
|
||||
|
Reference in New Issue
Block a user