summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorDaniel Black <daniel.black@au.ibm.com>2016-03-15 18:03:20 +1100
committerSergey Vojtovich <svoj@mariadb.org>2016-08-05 10:34:26 +0400
commite7e313f46f02c9a075f458502f0e4d6ac42880a6 (patch)
tree70ab3c741554cfac59aa196b2d369470ab8c4c76 /mysql-test
parent9c2215e022c325599bd1b66d1f2214529fb99a24 (diff)
downloadmariadb-git-e7e313f46f02c9a075f458502f0e4d6ac42880a6.tar.gz
test case for CRC32() SQL function
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/func_math.result6
-rw-r--r--mysql-test/t/func_math.test5
2 files changed, 11 insertions, 0 deletions
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index f7ca1aa3d03..703d9816f8b 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -805,3 +805,9 @@ STDDEV_POP(ROUND(0,@A:=2009))
select 0=0, 0=-0, 0.0= -0.0, 0.0 = -(0.0), 0.0E1=-0.0E1, 0.0E1=-(0.0E1);
0=0 0=-0 0.0= -0.0 0.0 = -(0.0) 0.0E1=-0.0E1 0.0E1=-(0.0E1)
1 1 1 1 1 1
+#
+# CRC32 tests
+#
+select CRC32(NULL), CRC32(''), CRC32('MySQL'), CRC32('mysql'), CRC32('01234567'), CRC32('012345678');
+CRC32(NULL) CRC32('') CRC32('MySQL') CRC32('mysql') CRC32('01234567') CRC32('012345678')
+NULL 0 3259397556 2501908538 763378421 939184570
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test
index fdda9c844ea..ad821645aeb 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -600,3 +600,8 @@ SELECT STDDEV_POP(ROUND(0,@A:=2009)) FROM (SELECT 1 UNION SELECT 2) fake_table;
--echo # Test zero
select 0=0, 0=-0, 0.0= -0.0, 0.0 = -(0.0), 0.0E1=-0.0E1, 0.0E1=-(0.0E1);
+--echo #
+--echo # CRC32 tests
+--echo #
+
+select CRC32(NULL), CRC32(''), CRC32('MySQL'), CRC32('mysql'), CRC32('01234567'), CRC32('012345678');