Build tested: 5.6.1-1 (Drone build 1442)
These is an issue with floor() on time data type.
MariaDB [mytest]> show create table t1;
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
t1 |
CREATE TABLE `t1` (
`c1` datetime DEFAULT NULL,
`c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`c3` time DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=latin1 |
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.001 sec)
insert into t1 values ('2021-01-04 11:34:00', now(), '11:34:00');
MariaDB [mytest]> select floor(c1), floor(c2), floor(c3) from t1;
-------------------------------------------------
floor(c1) |
floor(c2) |
floor(c3) |
-------------------------------------------------
2021-01-04 11:34:00 |
2021-01-04 17:56:09 |
00:00:00 |
-------------------------------------------------
1 row in set (0.016 sec)
MariaDB [mytest]> select ceiling(c1), ceiling(c2), ceiling(c3) from t1;
---------------------------------------------------
ceiling(c1) |
ceiling(c2) |
ceiling(c3) |
---------------------------------------------------
2021-01-04 11:34:00 |
2021-01-04 17:56:09 |
11:34:00 |
---------------------------------------------------
floor() on c3 returned '00:00:00'
It worked correctly on InnoDB table
The same test returned
MariaDB [mytest]> show create table t2;
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
t2 |
CREATE TABLE `t2` (
`c1` datetime DEFAULT NULL,
`c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`c3` time DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.001 sec)
insert into t2 values ('2021-01-04 11:34:00', now(), '11:34:00');
MariaDB [mytest]> select floor(c1), floor(c2), floor(c3) from t2;
-------------------------------------------------
floor(c1) |
floor(c2) |
floor(c3) |
-------------------------------------------------
2021-01-04 11:34:00 |
2021-01-04 18:06:36 |
11:34:00 |
-------------------------------------------------
1 row in set (0.002 sec)
Build tested: 5.6.1-1 (Drone build 1442)
These is an issue with floor() on time data type.
MariaDB [mytest]> show create table t1;
------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+`c1` datetime DEFAULT NULL,
`c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`c3` time DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=latin1
------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+1 row in set (0.001 sec)
insert into t1 values ('2021-01-04 11:34:00', now(), '11:34:00');
MariaDB [mytest]> select floor(c1), floor(c2), floor(c3) from t1;
--------------------
-------------------------------------------------
-------------------------------------------------
-----------------------------1 row in set (0.016 sec)
MariaDB [mytest]> select ceiling(c1), ceiling(c2), ceiling(c3) from t1;
--------------------
---------------------------------------------------
---------------------------------------------------
-------------------------------floor() on c3 returned '00:00:00'
It worked correctly on InnoDB table
The same test returned
MariaDB [mytest]> show create table t2;
------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+`c1` datetime DEFAULT NULL,
`c2` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`c3` time DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+1 row in set (0.001 sec)
insert into t2 values ('2021-01-04 11:34:00', now(), '11:34:00');
MariaDB [mytest]> select floor(c1), floor(c2), floor(c3) from t2;
--------------------
-------------------------------------------------
-------------------------------------------------
-----------------------------1 row in set (0.002 sec)