summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorunknown <hf@deer.(none)>2003-07-03 23:24:23 +0500
committerunknown <hf@deer.(none)>2003-07-03 23:24:23 +0500
commitb1785ea6c26cbbd21876ec4c731bc15cb9cdfa0f (patch)
tree1fe0dfdc51ca6c291c4889661490603f58cecd73 /sql/item_strfunc.cc
parent039a98774a4f450342ba75c2fe6f27dc641037ef (diff)
downloadmariadb-git-b1785ea6c26cbbd21876ec4c731bc15cb9cdfa0f.tar.gz
Fix for #739
check for negative count in RPAD added mysql-test/r/func_str.result: Appropriate result mysql-test/t/func_str.test: testcase added sql/item_strfunc.cc: we return NULL if count < 0
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 838fca807a2..caaff4d1613 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -1804,7 +1804,7 @@ String *Item_func_rpad::val_str(String *str)
String *res =args[0]->val_str(str);
String *rpad = args[2]->val_str(str);
- if (!res || args[1]->null_value || !rpad)
+ if (!res || args[1]->null_value || !rpad || count < 0)
goto err;
null_value=0;
if (count <= (int32) (res_length=res->length()))