summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorunknown <msvensson@pilot.blaudden>2007-03-28 09:33:16 +0200
committerunknown <msvensson@pilot.blaudden>2007-03-28 09:33:16 +0200
commitcce2cb5733909279d6ff2b1687b1082a8035fd58 (patch)
tree70ad22a58fe62de3be7b97b8eba11811ac842666 /sql/item_strfunc.cc
parent7c152303c62b4d812552e3dc476f6ada5a307cc4 (diff)
parente9b606bf3e0ccc9d9ff27541371cc5faf72dd813 (diff)
downloadmariadb-git-cce2cb5733909279d6ff2b1687b1082a8035fd58.tar.gz
Merge pilot.blaudden:/home/msvensson/mysql/bug25197/my50-bug25197
into pilot.blaudden:/home/msvensson/mysql/bug25197/my51-bug25197 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 faea5380a66..f92c328fc39 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)