1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-21 19:45:56 +03:00
mariadb-columnstore-engine/mysql-test/columnstore/basic/r/mcs217_makedate_function.result

48 lines
1.4 KiB
Plaintext

DROP DATABASE IF EXISTS mcs217_db;
CREATE DATABASE mcs217_db;
USE mcs217_db;
CREATE TABLE t1(t1_d DATE, t1_t TIME, t1_dt DATETIME)ENGINE=Columnstore;
INSERT INTO t1 VALUES(NULL, NULL, NULL);
INSERT INTO t1 VALUES('0000-00-00', '00:00:00', '0000-00-00');
INSERT INTO t1 VALUES('2222-11-11', '12:12:12', '2020-11-11 12:12:12');
INSERT INTO t1 VALUES('2020-01-01', '11:11:11', '2020-12-31 12:34:56');
INSERT INTO t1 VALUES('2016-02-01', '11:11:11', '2017-02-01 12:12:12');
SELECT t1_t, makedate(1111, t1_t) FROM t1 ORDER BY t1_t;
t1_t makedate(1111, t1_t)
NULL NULL
00:00:00 NULL
11:11:11 1415-03-07
11:11:11 1415-03-07
12:12:12 1442-10-31
SELECT t1_t, makedate(2222, t1_t) FROM t1 ORDER BY t1_t;
t1_t makedate(2222, t1_t)
NULL NULL
00:00:00 NULL
11:11:11 2526-03-07
11:11:11 2526-03-07
12:12:12 2553-10-31
SELECT t1_t, makedate(2020, t1_t) FROM t1 ORDER BY t1_t;
t1_t makedate(2020, t1_t)
NULL NULL
00:00:00 NULL
11:11:11 2324-03-07
11:11:11 2324-03-07
12:12:12 2351-11-01
SELECT t1_d, makedate(2000, t1_d) FROM t1 ORDER BY t1_d;
t1_d makedate(2000, t1_d)
NULL NULL
0000-00-00 NULL
2016-02-01 NULL
2020-01-01 NULL
2222-11-11 NULL
SELECT t1_dt, makedate(2000, t1_dt) FROM t1 ORDER BY t1_dt;
t1_dt makedate(2000, t1_dt)
NULL NULL
0000-00-00 00:00:00 NULL
2017-02-01 12:12:12 NULL
2020-11-11 12:12:12 NULL
2020-12-31 12:34:56 NULL
SELECT makedate(t1_d) FROM t1;
ERROR 42000: Incorrect parameter count in the call to native function 'makedate'
DROP DATABASE mcs217_db;