summaryrefslogtreecommitdiff
path: root/sql/sql_signal.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2015-02-27 16:26:12 +0400
committerAlexander Barkov <bar@mariadb.org>2015-02-27 16:26:12 +0400
commit72d7b12b9c9c5ceffef9fff3adc86c149f57f20f (patch)
tree7fd38d14cabf307e1ff2493af9497ba754afffba /sql/sql_signal.cc
parent2d01907c1d6c65ff6d851dec032540f2ff57caae (diff)
downloadmariadb-git-72d7b12b9c9c5ceffef9fff3adc86c149f57f20f.tar.gz
Reducing duplicate code and simplifying well formed string copying
by adding a new class String_copier. This is a pre-requisite patch for MDEV-6566 and MDEV-6572, to avoid adding more similar code.
Diffstat (limited to 'sql/sql_signal.cc')
-rw-r--r--sql/sql_signal.cc13
1 files changed, 3 insertions, 10 deletions
diff --git a/sql/sql_signal.cc b/sql/sql_signal.cc
index 374a24f75e5..f9933e68595 100644
--- a/sql/sql_signal.cc
+++ b/sql/sql_signal.cc
@@ -195,16 +195,9 @@ static bool assign_fixed_string(MEM_ROOT *mem_root,
dst_str= (char*) alloc_root(mem_root, dst_len + 1);
if (dst_str)
{
- const char* well_formed_error_pos;
- const char* cannot_convert_error_pos;
- const char* from_end_pos;
-
- dst_copied= well_formed_copy_nchars(dst_cs, dst_str, dst_len,
- src_cs, src_str, src_len,
- numchars,
- & well_formed_error_pos,
- & cannot_convert_error_pos,
- & from_end_pos);
+ dst_copied= String_copier().well_formed_copy(dst_cs, dst_str, dst_len,
+ src_cs, src_str, src_len,
+ numchars);
DBUG_ASSERT(dst_copied <= dst_len);
dst_len= dst_copied; /* In case the copy truncated the data */
dst_str[dst_copied]= '\0';