summaryrefslogtreecommitdiff
path: root/mysql-test/t/func_math.test
diff options
context:
space:
mode:
authorunknown <kaa@polly.local>2007-04-28 20:04:03 +0400
committerunknown <kaa@polly.local>2007-04-28 20:04:03 +0400
commit59a35c9afcdcf9dd9cd9f127dcd417ac7dc0e2c1 (patch)
treec87d798baa97ec3d7f94149623cfb252e838756e /mysql-test/t/func_math.test
parent272563d81bfd3a736aaf7cabc5bd7e2587adbe47 (diff)
parent38090df9b566da89942f8a90fe71a3fac31efb9d (diff)
downloadmariadb-git-59a35c9afcdcf9dd9cd9f127dcd417ac7dc0e2c1.tar.gz
Merge polly.local:/home/kaa/src/maint/bug24912/my50-bug24912
into polly.local:/home/kaa/src/maint/bug24912/my51-bug24912 mysql-test/r/type_newdecimal.result: Auto merged mysql-test/t/func_math.test: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/mysql_priv.h: Auto merged mysql-test/r/func_math.result: Manual merge. sql/item_strfunc.cc: Manual merge.
Diffstat (limited to 'mysql-test/t/func_math.test')
-rw-r--r--mysql-test/t/func_math.test39
1 files changed, 34 insertions, 5 deletions
diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test
index 639ced6a1c0..668528b2e9b 100644
--- a/mysql-test/t/func_math.test
+++ b/mysql-test/t/func_math.test
@@ -88,11 +88,6 @@ drop table t1;
#
-# Bug #10083 (round doesn't increase decimals)
-#
-select round(150, 2);
-
-#
# Bug @10632 (Ceiling function returns wrong answer)
#
select ceil(0.09);
@@ -196,3 +191,37 @@ select format(t2.f2-t2.f1+1,0) from t1,t2
where t1.f2 = t2.f3 order by t1.f1;
drop table t1, t2;
set names default;
+
+# Bug 24912 -- misc functions have trouble with unsigned
+
+select cast(-2 as unsigned), 18446744073709551614, -2;
+select abs(cast(-2 as unsigned)), abs(18446744073709551614), abs(-2);
+select ceiling(cast(-2 as unsigned)), ceiling(18446744073709551614), ceiling(-2);
+select floor(cast(-2 as unsigned)), floor(18446744073709551614), floor(-2);
+select format(cast(-2 as unsigned), 2), format(18446744073709551614, 2), format(-2, 2);
+select sqrt(cast(-2 as unsigned)), sqrt(18446744073709551614), sqrt(-2);
+select round(cast(-2 as unsigned), 1), round(18446744073709551614, 1), round(-2, 1);
+select round(4, cast(-2 as unsigned)), round(4, 18446744073709551614), round(4, -2);
+select truncate(cast(-2 as unsigned), 1), truncate(18446744073709551614, 1), truncate(-2, 1);
+select truncate(4, cast(-2 as unsigned)), truncate(4, 18446744073709551614), truncate(4, -2);
+select round(10000000000000000000, -19), truncate(10000000000000000000, -19);
+select round(1e0, -309), truncate(1e0, -309);
+select round(1e1,308), truncate(1e1, 308);
+select round(1e1, 2147483648), truncate(1e1, 2147483648);
+select round(1.1e1, 4294967295), truncate(1.1e1, 4294967295);
+select round(1.12e1, 4294967296), truncate(1.12e1, 4294967296);
+select round(1.5, 2147483640), truncate(1.5, 2147483640);
+select round(1.5, -2147483649), round(1.5, 2147483648);
+select truncate(1.5, -2147483649), truncate(1.5, 2147483648);
+select round(1.5, -4294967296), round(1.5, 4294967296);
+select truncate(1.5, -4294967296), truncate(1.5, 4294967296);
+select round(1.5, -9223372036854775808), round(1.5, 9223372036854775808);
+select truncate(1.5, -9223372036854775808), truncate(1.5, 9223372036854775808);
+select round(1.5, 18446744073709551615), truncate(1.5, 18446744073709551615);
+select round(18446744073709551614, -1), truncate(18446744073709551614, -1);
+select round(4, -4294967200), truncate(4, -4294967200);
+select mod(cast(-2 as unsigned), 3), mod(18446744073709551614, 3), mod(-2, 3);
+select mod(5, cast(-2 as unsigned)), mod(5, 18446744073709551614), mod(5, -2);
+select pow(cast(-2 as unsigned), 5), pow(18446744073709551614, 5), pow(-2, 5);
+
+--echo End of 5.0 tests