ClickHouse/tests/queries/0_stateless/02834_timestamp_function.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
1.4 KiB
MySQL
Raw Normal View History

2023-09-28 01:14:35 +00:00
SET session_timezone = 'UTC';
2023-09-27 20:24:31 +00:00
SELECT timestamp('2013-12-31');
SELECT timestamp('2013-12-31 12:00:00');
SELECT timestamp('2013-12-31 12:00:00.111111');
SELECT timestamp('2013-12-31 12:00:00.1111111'); -- ignore > 6 fractional parts
SELECT timestamp('2013-12-31 12:00:00', '12:01:02');
SELECT timestamp('2013-12-31 12:00:00', '12:01:02.1');
SELECT timestamp('2013-12-31 12:00:00', '12:01:02.11');
SELECT timestamp('2013-12-31 12:00:00', '12:01:02.111');
SELECT timestamp('2013-12-31 12:00:00', '12:01:02.1111');
SELECT timestamp('2013-12-31 12:00:00', '12:01:02.11111');
SELECT timestamp('2013-12-31 12:00:00', '12:01:02.111111');
SELECT timestamp('2013-12-31 12:00:00', '-12:01:02.111111');
SELECT timestamp('2013-12-31 12:00:00', '-1:01:02.111111');
SELECT timestamp('2013-12-31 12:00:00', '-100:01:02.111111');
SELECT timestamp('2013-12-31 12:00:00', '32767:01:02.111111');
SELECT timestamp('2013-12-31 12:00:00', '32768:01:02.111111'); -- roll over
SELECT timestamp(materialize('2013-12-31'));
SELECT timestamp(materialize('2013-12-31 12:00:00'), materialize('12:00:00'));
2023-09-14 16:01:45 +00:00
2023-09-27 20:24:31 +00:00
SELECT TIMESTAMP('2013-12-31');
2023-09-27 20:24:31 +00:00
SELECT timestamp(); -- { serverError NUMBER_OF_ARGUMENTS_DOESNT_MATCH }
SELECT timestamp('2013-12-31 12:00:00', '12:00:00', ''); -- { serverError NUMBER_OF_ARGUMENTS_DOESNT_MATCH }
SELECT timestamp(1); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }
SELECT timestamp(1, 2); -- { serverError ILLEGAL_TYPE_OF_ARGUMENT }