summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
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;