ClickHouse/tests/queries/0_stateless/01544_fromModifiedJulianDay.sql

28 lines
890 B
MySQL
Raw Normal View History

2020-12-07 15:47:57 +00:00
--
SELECT 'Invocation with constant';
SELECT fromModifiedJulianDay(-1);
SELECT fromModifiedJulianDay(0);
SELECT fromModifiedJulianDay(59154);
SELECT fromModifiedJulianDay(NULL);
SELECT fromModifiedJulianDay(CAST(NULL, 'Nullable(Int64)'));
2020-12-07 15:47:57 +00:00
SELECT fromModifiedJulianDay(-678942); -- { serverError 490 }
SELECT fromModifiedJulianDay(2973484); -- { serverError 490 }
SELECT 'or null';
SELECT fromModifiedJulianDayOrNull(59154);
SELECT fromModifiedJulianDayOrNull(NULL);
SELECT fromModifiedJulianDayOrNull(-678942);
SELECT fromModifiedJulianDayOrNull(2973484);
--
SELECT 'Invocation with Int32 column';
DROP TABLE IF EXISTS fromModifiedJulianDay_test;
CREATE TABLE fromModifiedJulianDay_test (d Int32) ENGINE = Memory;
INSERT INTO fromModifiedJulianDay_test VALUES (-1), (0), (59154);
SELECT fromModifiedJulianDay(d) FROM fromModifiedJulianDay_test;
DROP TABLE fromModifiedJulianDay_test;