summaryrefslogtreecommitdiff
path: root/sql/sql_string.cc
diff options
context:
space:
mode:
authorunknown <sanja@askmonty.org>2012-12-23 23:37:11 +0200
committerunknown <sanja@askmonty.org>2012-12-23 23:37:11 +0200
commit61412c0c31138ca2e08636c10823bc55e6a7a84c (patch)
treeaf7b89ebb5f2334b21ab1f658d764829bfcbf7e1 /sql/sql_string.cc
parent88b59efef6ae869bac9d14cefe2982a1061d3c93 (diff)
parent082ff5931770ed70df0ec1e85f81fa880a4d9e62 (diff)
downloadmariadb-git-61412c0c31138ca2e08636c10823bc55e6a7a84c.tar.gz
pre-merge
Diffstat (limited to 'sql/sql_string.cc')
-rw-r--r--sql/sql_string.cc73
1 files changed, 0 insertions, 73 deletions
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 89536b93feb..126139cd219 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -768,79 +768,6 @@ String *copy_if_not_alloced(String *to,String *from,uint32 from_length)
Help functions
****************************************************************************/
-/*
- copy a string from one character set to another
-
- SYNOPSIS
- copy_and_convert()
- to Store result here
- to_cs Character set of result string
- from Copy from here
- from_length Length of from string
- from_cs From character set
-
- NOTES
- 'to' must be big enough as form_length * to_cs->mbmaxlen
-
- RETURN
- length of bytes copied to 'to'
-*/
-
-
-static uint32
-copy_and_convert_extended(char *to, uint32 to_length, CHARSET_INFO *to_cs,
- const char *from, uint32 from_length,
- CHARSET_INFO *from_cs,
- uint *errors)
-{
- int cnvres;
- my_wc_t wc;
- const uchar *from_end= (const uchar*) from+from_length;
- char *to_start= to;
- uchar *to_end= (uchar*) to+to_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)
- {
- if ((cnvres= (*mb_wc)(from_cs, &wc, (uchar*) from,
- from_end)) > 0)
- from+= cnvres;
- else if (cnvres == MY_CS_ILSEQ)
- {
- error_count++;
- from++;
- wc= '?';
- }
- else if (cnvres > MY_CS_TOOSMALL)
- {
- /*
- A correct multibyte sequence detected
- But it doesn't have Unicode mapping.
- */
- error_count++;
- from+= (-cnvres);
- wc= '?';
- }
- else
- break; // Not enough characters
-
-outp:
- if ((cnvres= (*wc_mb)(to_cs, wc, (uchar*) to, to_end)) > 0)
- to+= cnvres;
- else if (cnvres == MY_CS_ILUNI && wc != '?')
- {
- error_count++;
- wc= '?';
- goto outp;
- }
- else
- break;
- }
- *errors= error_count;
- return (uint32) (to - to_start);
-}
/*