1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-11-27 08:21:15 +03:00
Files
mariadb-columnstore-engine/mtr/basic/t/mcs251_time_to_sec_function.test
mariadb-RomanNavrotskiy 73b4147cf3 move mtr suites here
2021-01-31 01:38:31 +02:00

33 lines
812 B
Plaintext

#
# TIME_TO_SEC() function
# Author: Bharath, bharath.bokka@mariadb.com
#
-- source ../include/have_columnstore.inc
--disable_warnings
DROP DATABASE IF EXISTS mcs251_db;
--enable_warnings
CREATE DATABASE mcs251_db;
USE mcs251_db;
CREATE TABLE t1
(
t1_INT INT,
t1_TIME TIME,
t1_DATETIME DATETIME
)ENGINE=Columnstore;
INSERT INTO t1 VALUES(1, '22:12:02', '1997-12-12 22:12:02');
INSERT INTO t1 VALUES(2, '23:59:59', '2001-1-1 23:59:59');
INSERT INTO t1 VALUES(3, '01:00:00', '09-12-11 01:08:59');
SELECT TIME_TO_SEC('00:00:00') FROM t1 LIMIT 1;
SELECT TIME_TO_SEC('24:00:00') FROM t1 LIMIT 1;
SELECT TIME_TO_SEC('10:50:40.9999') FROM t1 LIMIT 1;
SELECT t1_TIME, TIME_TO_SEC(t1_TIME) FROM t1 ORDER BY 1;
SELECT t1_DATETIME, TIME_TO_SEC(t1_DATETIME) FROM t1 ORDER BY 1;
# Clean UP
DROP DATABASE mcs251_db;