1
SELECT CAST("12" AS SIGNED);
2
SELECT CAST(12 AS SIGNED);
3
SELECT CAST(0 AS SIGNED);
4
SELECT CAST("0" AS SIGNED);
7
# Check rounding issues for CAST
8
SELECT CAST(0.0 AS SIGNED);
9
SELECT CAST(0.1 AS SIGNED);
10
SELECT CAST(0.4 AS SIGNED);
11
SELECT CAST(0.5 AS SIGNED);
12
SELECT CAST(0.9 AS SIGNED);
13
SELECT CAST(10.1 AS SIGNED);
16
--error ER_INVALID_CAST_TO_SIGNED
17
SELECT CAST("18446744073709551615" AS SIGNED);
19
--error ER_INVALID_CAST_TO_SIGNED
20
SELECT CAST(18446744073709551615 AS SIGNED);
22
SELECT CAST(-1 AS SIGNED);
24
--error ER_INVALID_CAST_TO_SIGNED
25
SELECT CAST(-18446744073709551614 AS SIGNED);
26
--error ER_INVALID_CAST_TO_SIGNED
27
SELECT CAST(-18446744073709551615 AS SIGNED);
29
SELECT CAST("-1" AS SIGNED);
31
--error ER_INVALID_CAST_TO_SIGNED
32
SELECT CAST("-18446744073709551614" AS SIGNED);
33
--error ER_INVALID_CAST_TO_SIGNED
34
SELECT CAST("-18446744073709551615" AS SIGNED);
36
SELECT CAST(-1.1 AS SIGNED);
38
--error ER_INVALID_CAST_TO_SIGNED
39
SELECT CAST(-18446744073709551614.1 AS SIGNED);
40
--error ER_INVALID_CAST_TO_SIGNED
41
SELECT CAST(-18446744073709551615.1 AS SIGNED);
43
SELECT CAST("-1.1" AS SIGNED);
45
--error ER_INVALID_CAST_TO_SIGNED
46
SELECT CAST("-18446744073709551614.1" AS SIGNED);
48
--error ER_INVALID_CAST_TO_SIGNED
49
SELECT CAST("-18446744073709551615.1" AS SIGNED);
51
SELECT CAST(9223372036854775807 AS SIGNED);
53
--error ER_INVALID_CAST_TO_SIGNED
54
SELECT CAST(9223372036854775808 AS SIGNED);
55
--error ER_INVALID_CAST_TO_SIGNED
56
SELECT CAST(-9223372036854775809 AS SIGNED);
58
SELECT CAST(-9223372036854775808 AS SIGNED);
59
SELECT CAST(-9223372036854775807 AS SIGNED);
60
SELECT CAST(-9223372036854775806 AS SIGNED);
61
SELECT CAST(-9223372036854775805 AS SIGNED);