summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_str.test
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 /mysql-test/t/func_str.test
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 'mysql-test/t/func_str.test')
-rw-r--r--mysql-test/t/func_str.test26
1 files changed, 26 insertions, 0 deletions
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 535af6907ad..3314a229d57 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -1115,4 +1115,30 @@ select repeat('a', cast(2 as unsigned int));
select rpad('abc', cast(5 as unsigned integer), 'x');
select lpad('abc', cast(5 as unsigned integer), 'x');
+
+#
+# Bug #25197 :repeat function returns null when using table field directly as count
+#
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE `t1` (
+ `id` varchar(20) NOT NULL,
+ `tire` tinyint(3) unsigned NOT NULL,
+ PRIMARY KEY (`id`)
+);
+
+INSERT INTO `t1` (`id`, `tire`) VALUES ('A', 0), ('B', 1),('C', 2);
+
+SELECT REPEAT( '#', tire ) AS A,
+ REPEAT( '#', tire % 999 ) AS B, tire FROM `t1`;
+
+SELECT REPEAT('0', CAST(0 AS UNSIGNED));
+SELECT REPEAT('0', -2);
+SELECT REPEAT('0', 2);
+
+DROP TABLE t1;
+
--echo End of 5.0 tests