summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_str.test
diff options
context:
space:
mode:
authorunknown <tnurnberg@mysql.com/white.intern.koehntopp.de>2008-02-24 01:31:54 +0100
committerunknown <tnurnberg@mysql.com/white.intern.koehntopp.de>2008-02-24 01:31:54 +0100
commit7b8717ace88805a6a243a2800fc7d3fc70d2fddc (patch)
treecd84aa795f9c47d4d5eff3b0deae320b06e2507a /mysql-test/t/func_str.test
parent72f1b329e16f8911cb445d11f2ad3367196f7737 (diff)
downloadmariadb-git-7b8717ace88805a6a243a2800fc7d3fc70d2fddc.tar.gz
Bug#20752: BENCHMARK with many iterations returns too quickly
In BENCHMARK(count, expr), count could overflow/wrap-around. Patch changes to a sufficiently large data-type. Adds a warning for negative count values. mysql-test/r/func_str.result: show that a negative 'count' for BENCHMARK(count, expr) throws a warning and returns NULL. mysql-test/t/func_str.test: show that a negative 'count' for BENCHMARK(count, expr) throws a warning and returns NULL. sql/item_func.cc: use ulonglong rather than ulong in BENCHMARK(count, expr) throw warning on negative 'count'; return SQL-NULL.
Diffstat (limited to 'mysql-test/t/func_str.test')
-rw-r--r--mysql-test/t/func_str.test7
1 files changed, 7 insertions, 0 deletions
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index b6da14211ae..5a5f4024bc4 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -875,6 +875,13 @@ select benchmark(100, NULL);
select benchmark(NULL, 1+1);
#
+# Bug #20752: BENCHMARK with many iterations returns too quickly
+#
+
+# not a string, but belongs with the above Bug#22684
+select benchmark(-1, 1);
+
+#
# Please note:
# 1) The collation of the password is irrelevant, the encryption uses
# the binary representation of the string without charset/collation.