diff options
author | Michael Widenius <monty@askmonty.org> | 2013-07-03 22:50:34 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2013-07-03 22:50:34 +0300 |
commit | a9d1d76e5eb33d7d7762140625d09bbfb9ae91bb (patch) | |
tree | 8bc0efc14fbc8ff396dec2a802545bfc8ec7c6ca /sql/strfunc.cc | |
parent | 68262ba648886e2d5f35fc85e3cc45df7ffd9ae5 (diff) | |
download | mariadb-git-a9d1d76e5eb33d7d7762140625d09bbfb9ae91bb.tar.gz |
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.
Diffstat (limited to 'sql/strfunc.cc')
-rw-r--r-- | sql/strfunc.cc | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sql/strfunc.cc b/sql/strfunc.cc index 9603ca30cfa..b8126fab048 100644 --- a/sql/strfunc.cc +++ b/sql/strfunc.cc @@ -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; |