ClickHouse/tests/queries/0_stateless/01186_conversion_to_nullable.sql

14 lines
970 B
MySQL
Raw Normal View History

2020-12-24 00:13:53 +00:00
select toUInt8(x) from values('x Nullable(String)', '42', NULL, '0', '', '256');
select toInt64(x) from values('x Nullable(String)', '42', NULL, '0', '', '256');
select toDate(x) from values('x Nullable(String)', '2020-12-24', NULL, '0000-00-00', '', '9999-01-01');
2021-02-22 16:22:09 +00:00
select toDateTime(x, 'Europe/Moscow') from values('x Nullable(String)', '2020-12-24 01:02:03', NULL, '0000-00-00 00:00:00', '');
select toDateTime64(x, 2, 'Europe/Moscow') from values('x Nullable(String)', '2020-12-24 01:02:03', NULL, '0000-00-00 00:00:00', '');
2021-07-18 15:09:48 +00:00
select toUnixTimestamp(x, 'Europe/Moscow') from values ('x Nullable(String)', '2000-01-01 13:12:12', NULL, '');
2020-12-24 00:13:53 +00:00
select toDecimal32(x, 2) from values ('x Nullable(String)', '42', NULL, '3.14159');
select toDecimal64(x, 8) from values ('x Nullable(String)', '42', NULL, '3.14159');
select toString(x) from values ('x Nullable(String)', '42', NULL, 'test');
select toFixedString(x, 8) from values ('x Nullable(String)', '42', NULL, 'test');