1
Fork 0
kantodb/testdata/sql/cast.slt

36 lines
715 B
Text

query I
SELECT CAST('42' AS INTEGER);
----
42
query I
SELECT CAST('42' AS BIGINT UNSIGNED);
----
42
query I
SELECT 42::BIGINT UNSIGNED;
----
42
statement error ^Arrow error: Cast error: Cannot cast string '-1' to value of UInt64 type$
SELECT CAST('-1' AS BIGINT UNSIGNED);
statement error ^Arrow error: Cast error: Cannot cast string '18446744073709551616' to value of UInt64 type$
SELECT CAST('18446744073709551616' AS BIGINT UNSIGNED);
query I
SELECT CAST('18446744073709551615' AS BIGINT UNSIGNED);
----
18446744073709551615
query I
SELECT 18446744073709551615::BIGINT UNSIGNED;
----
18446744073709551615
# silent wraparound
query I
SELECT 18446744073709551615::BIGINT UNSIGNED+1::BIGINT UNSIGNED;
----
0