summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorunknown <msvensson@pilot.blaudden>2007-02-28 11:21:54 +0100
committerunknown <msvensson@pilot.blaudden>2007-02-28 11:21:54 +0100
commit031e62ecee0947d3592c015f6f3890c8754f764e (patch)
tree6a2eb492fae60161191448cd7e6aeb3ba47d1478 /sql/item_strfunc.cc
parent6b890467b5741494acdf7817a9f19393d041b535 (diff)
parent65fc58524f6f641efef1b4a214d281c05df34029 (diff)
downloadmariadb-git-031e62ecee0947d3592c015f6f3890c8754f764e.tar.gz
Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
into pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint mysql-test/r/func_str.result: Auto merged mysql-test/t/func_str.test: Auto merged sql/item_strfunc.cc: Auto merged
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index 78710c2cfeb..4201a303791 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -2274,8 +2274,10 @@ String *Item_func_repeat::val_str(String *str)
if (args[0]->null_value || args[1]->null_value)
goto err; // string and/or delim are null
null_value= 0;
- if ((count <= 0) && !args[1]->unsigned_flag) // For nicer SQL code
+
+ if (count == 0 || count < 0 && !args[1]->unsigned_flag)
return &my_empty_string;
+
/* Assumes that the maximum length of a String is < INT_MAX32. */
/* Bounds check on count: If this is triggered, we will error. */
if ((ulonglong) count > INT_MAX32)