summaryrefslogtreecommitdiff
path: root/strings
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2014-09-18 12:40:55 +0400
committerAlexander Barkov <bar@mariadb.org>2014-09-18 12:40:55 +0400
commit8286bcd721a4555a1b49502d83caafc54c1752a6 (patch)
tree50d2ffae19ff3537631c709a829317b83c08fc29 /strings
parent391fddf6604c733f271b96189caa366049cc6ee4 (diff)
downloadmariadb-git-8286bcd721a4555a1b49502d83caafc54c1752a6.tar.gz
MDEV-6752 Trailing incomplete characters are not replaced to question marks on conversion
Diffstat (limited to 'strings')
-rw-r--r--strings/ctype.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/strings/ctype.c b/strings/ctype.c
index 38c377c6da5..048fbe3d368 100644
--- a/strings/ctype.c
+++ b/strings/ctype.c
@@ -1066,7 +1066,14 @@ my_convert_internal(char *to, uint32 to_length,
wc= '?';
}
else
- break; // Not enough characters
+ {
+ if ((uchar *) from >= from_end)
+ break; /* End of line */
+ /* Incomplete byte sequence */
+ error_count++;
+ from++;
+ wc= '?';
+ }
outp:
if ((cnvres= (*wc_mb)(to_cs, wc, (uchar*) to, to_end)) > 0)