summaryrefslogtreecommitdiff
path: root/mysql-test/r/func_math.result
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r/func_math.result')
-rw-r--r--mysql-test/r/func_math.result42
1 files changed, 35 insertions, 7 deletions
diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result
index 40eb6c5f543..4a61a16bbec 100644
--- a/mysql-test/r/func_math.result
+++ b/mysql-test/r/func_math.result
@@ -285,33 +285,55 @@ set names default;
select cast(-2 as unsigned), 18446744073709551614, -2;
cast(-2 as unsigned) 18446744073709551614 -2
18446744073709551614 18446744073709551614 -2
+Warnings:
+Warning 1105 Cast to unsigned converted negative integer to it's positive complement
select abs(cast(-2 as unsigned)), abs(18446744073709551614), abs(-2);
abs(cast(-2 as unsigned)) abs(18446744073709551614) abs(-2)
18446744073709551614 18446744073709551614 2
+Warnings:
+Warning 1105 Cast to unsigned converted negative integer to it's positive complement
select ceiling(cast(-2 as unsigned)), ceiling(18446744073709551614), ceiling(-2);
ceiling(cast(-2 as unsigned)) ceiling(18446744073709551614) ceiling(-2)
18446744073709551614 18446744073709551614 -2
+Warnings:
+Warning 1105 Cast to unsigned converted negative integer to it's positive complement
select floor(cast(-2 as unsigned)), floor(18446744073709551614), floor(-2);
floor(cast(-2 as unsigned)) floor(18446744073709551614) floor(-2)
18446744073709551614 18446744073709551614 -2
+Warnings:
+Warning 1105 Cast to unsigned converted negative integer to it's positive complement
select format(cast(-2 as unsigned), 2), format(18446744073709551614, 2), format(-2, 2);
format(cast(-2 as unsigned), 2) format(18446744073709551614, 2) format(-2, 2)
18,446,744,073,709,551,614.00 18,446,744,073,709,551,614.00 -2.00
+Warnings:
+Warning 1105 Cast to unsigned converted negative integer to it's positive complement
select sqrt(cast(-2 as unsigned)), sqrt(18446744073709551614), sqrt(-2);
sqrt(cast(-2 as unsigned)) sqrt(18446744073709551614) sqrt(-2)
4294967296 4294967296 NULL
+Warnings:
+Warning 1105 Cast to unsigned converted negative integer to it's positive complement
select round(cast(-2 as unsigned), 1), round(18446744073709551614, 1), round(-2, 1);
round(cast(-2 as unsigned), 1) round(18446744073709551614, 1) round(-2, 1)
18446744073709551614 18446744073709551614 -2
+Warnings:
+Warning 1105 Cast to unsigned converted negative integer to it's positive complement
select round(4, cast(-2 as unsigned)), round(4, 18446744073709551614), round(4, -2);
round(4, cast(-2 as unsigned)) round(4, 18446744073709551614) round(4, -2)
4 4 0
+Warnings:
+Warning 1105 Cast to unsigned converted negative integer to it's positive complement
+Warning 1105 Cast to unsigned converted negative integer to it's positive complement
select truncate(cast(-2 as unsigned), 1), truncate(18446744073709551614, 1), truncate(-2, 1);
truncate(cast(-2 as unsigned), 1) truncate(18446744073709551614, 1) truncate(-2, 1)
18446744073709551614 18446744073709551614 -2
+Warnings:
+Warning 1105 Cast to unsigned converted negative integer to it's positive complement
select truncate(4, cast(-2 as unsigned)), truncate(4, 18446744073709551614), truncate(4, -2);
truncate(4, cast(-2 as unsigned)) truncate(4, 18446744073709551614) truncate(4, -2)
4 4 0
+Warnings:
+Warning 1105 Cast to unsigned converted negative integer to it's positive complement
+Warning 1105 Cast to unsigned converted negative integer to it's positive complement
select round(10000000000000000000, -19), truncate(10000000000000000000, -19);
round(10000000000000000000, -19) truncate(10000000000000000000, -19)
10000000000000000000 10000000000000000000
@@ -363,12 +385,18 @@ round(4, -4294967200) truncate(4, -4294967200)
select mod(cast(-2 as unsigned), 3), mod(18446744073709551614, 3), mod(-2, 3);
mod(cast(-2 as unsigned), 3) mod(18446744073709551614, 3) mod(-2, 3)
2 2 -2
+Warnings:
+Warning 1105 Cast to unsigned converted negative integer to it's positive complement
select mod(5, cast(-2 as unsigned)), mod(5, 18446744073709551614), mod(5, -2);
mod(5, cast(-2 as unsigned)) mod(5, 18446744073709551614) mod(5, -2)
5 5 1
+Warnings:
+Warning 1105 Cast to unsigned converted negative integer to it's positive complement
select pow(cast(-2 as unsigned), 5), pow(18446744073709551614, 5), pow(-2, 5);
pow(cast(-2 as unsigned), 5) pow(18446744073709551614, 5) pow(-2, 5)
2.13598703592091e96 2.13598703592091e96 -32
+Warnings:
+Warning 1105 Cast to unsigned converted negative integer to it's positive complement
CREATE TABLE t1 (a timestamp, b varchar(20), c bit(1));
INSERT INTO t1 VALUES('1998-09-23', 'str1', 1), ('2003-03-25', 'str2', 0);
SELECT a DIV 900 y FROM t1 GROUP BY y;
@@ -383,9 +411,9 @@ SELECT b DIV 900 y FROM t1 GROUP BY y;
y
0
Warnings:
-Warning 1366 Incorrect decimal value: '' for column '' at row 0
+Warning 1918 Encountered illegal value '' when converting to DECIMAL
Warning 1292 Truncated incorrect DECIMAL value: 'str1'
-Warning 1366 Incorrect decimal value: '' for column '' at row 0
+Warning 1918 Encountered illegal value '' when converting to DECIMAL
Warning 1292 Truncated incorrect DECIMAL value: 'str2'
SELECT c DIV 900 y FROM t1 GROUP BY y;
y
@@ -499,7 +527,7 @@ select "123456789012345678901234567890.123456789012345678901234567890" div 1 as
ERROR 22003: BIGINT value is out of range in '('123456789012345678901234567890.123456789012345678901234567890' DIV 1)'
SHOW WARNINGS;
Level Code Message
-Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1916 Got overflow when converting '123456789012345678901234567890.123456789012345678901234567890000000' to INT. Value truncated.
Error 1690 BIGINT value is out of range in '('123456789012345678901234567890.123456789012345678901234567890' DIV 1)'
#
# Bug#57810 case/when/then : Assertion failed: length || !scale
@@ -632,9 +660,9 @@ ERROR 22003: BIGINT UNSIGNED value is out of range in '(18446744073709551615 DIV
CREATE TABLE t1(a BIGINT, b BIGINT UNSIGNED);
INSERT INTO t1 VALUES(-9223372036854775808, 9223372036854775809);
SELECT -a FROM t1;
-ERROR 22003: BIGINT value is out of range in '-('-9223372036854775808')'
+ERROR 22003: BIGINT value is out of range in '-(-9223372036854775808)'
SELECT -b FROM t1;
-ERROR 22003: BIGINT value is out of range in '-('9223372036854775809')'
+ERROR 22003: BIGINT value is out of range in '-(9223372036854775809)'
DROP TABLE t1;
SET @a:=999999999999999999999999999999999999999999999999999999999999999999999999999999999;
SELECT @a + @a;
@@ -684,7 +712,7 @@ SELECT ((@a:=@b:=1.0) div (@b:=@a:=get_format(datetime, 'usa')));
((@a:=@b:=1.0) div (@b:=@a:=get_format(datetime, 'usa')))
NULL
Warnings:
-Warning 1366 Incorrect decimal value: '' for column '' at row 0
+Warning 1918 Encountered illegal value '' when converting to DECIMAL
#
# Bug #59498 div function broken in mysql-trunk
#
@@ -698,4 +726,4 @@ select (1.175494351E-37 div 1.7976931348623157E+308);
(1.175494351E-37 div 1.7976931348623157E+308)
0
Warnings:
-Warning 1292 Truncated incorrect DECIMAL value: ''
+Warning 1916 Got overflow when converting '' to DECIMAL. Value truncated.