summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-11-19 17:23:39 +0100
committerSergei Golubchik <sergii@pisem.net>2014-11-19 17:23:39 +0100
commit3495801e2e94df5a10cae6e056f65defa038a6b6 (patch)
treede524b4bf45dbc19a95262843f2b72d0f5adb7bc /sql/item_strfunc.cc
parentdf7b27f1fe308fd4011fa020bebd7c69bcd43383 (diff)
parent496fda66fdc34b447ef4dec26d1250b034a321e3 (diff)
downloadmariadb-git-3495801e2e94df5a10cae6e056f65defa038a6b6.tar.gz
5.5 merge
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 339d053eade..402dbef00b7 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -3274,6 +3274,18 @@ String *Item_func_lpad::val_str(String *str)
res->set_charset(&my_charset_bin);
pad->set_charset(&my_charset_bin);
}
+#if MARIADB_VERSION_ID < 1000000
+ /*
+ Well-formedness is handled on a higher level in 10.0,
+ no needs to check it here again.
+ */ else
+ {
+ // This will chop off any trailing illegal characters from pad.
+ String *well_formed_pad= args[2]->check_well_formed_result(pad, false);
+ if (!well_formed_pad)
+ goto err;
+ }
+#endif
res_char_length= res->numchars();
@@ -4195,7 +4207,7 @@ String *Item_func_uncompress::val_str(String *str)
goto err;
if ((err= uncompress((Byte*)buffer.ptr(), &new_size,
- ((const Bytef*)res->ptr())+4,res->length())) == Z_OK)
+ ((const Bytef*)res->ptr())+4,res->length()-4)) == Z_OK)
{
buffer.length((uint32) new_size);
return &buffer;