diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-08-17 07:07:11 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-08-17 07:07:11 +0400 |
commit | a70809c0fcd5eca38c5f6bafa92270f1704a0597 (patch) | |
tree | 3e93cf1f8c41cf67b4b82bbaaec1c371d838eb6a /sql/item_strfunc.cc | |
parent | ff3cf7497447a4fce4554f571950fcde7f7e493a (diff) | |
download | mariadb-git-a70809c0fcd5eca38c5f6bafa92270f1704a0597.tar.gz |
MDEV-13555 Assertion `!item->null_value' failed in Type_handler::Item_send_str
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r-- | sql/item_strfunc.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 3b1dbf57fc4..6138b67c02e 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -3267,10 +3267,11 @@ String *Item_func_rpad::val_str(String *str) ((count < 0) && !args[1]->unsigned_flag)) goto err; + null_value=0; + if (count == 0) return make_empty_result(); - null_value=0; /* Assumes that the maximum length of a String is < INT_MAX32. */ /* Set here so that rest of code sees out-of-bound value as such. */ if ((ulonglong) count > INT_MAX32) @@ -3358,10 +3359,11 @@ String *Item_func_lpad::val_str(String *str) ((count < 0) && !args[1]->unsigned_flag)) goto err; + null_value=0; + if (count == 0) return make_empty_result(); - null_value=0; /* Assumes that the maximum length of a String is < INT_MAX32. */ /* Set here so that rest of code sees out-of-bound value as such. */ if ((ulonglong) count > INT_MAX32) |