Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
23.02.2
-
None
-
None
-
2024-1
Description
Easy to reproduce:
-- COLUMNSTORE
|
create table my_colstore_tab(`yyyymmdd` date DEFAULT NULL) engine=COLUMNSTORE;
|
insert into my_colstore_tab values(date(now()));
|
insert into my_colstore_tab values(date(now()-interval 1 year));
|
|
select day(s.yyyymmdd) as OK_1, last_day(s.yyyymmdd) as OK_2, day(last_day(s.yyyymmdd)) as NOT_OK from my_colstore_tab s;
|
+------+------------+--------+
|
| OK_1 | OK_2 | NOT_OK |
|
+------+------------+--------+
|
| 21 | 2024-02-29 | 0 |
|
| 21 | 2023-02-28 | 0 |
|
+------+------------+--------+
|
|
|
-- INNODB
|
create table my_innodb_tab(`yyyymmdd` date DEFAULT NULL) engine=INNODB;
|
insert into my_innodb_tab values(date(now()));
|
insert into my_innodb_tab values(date(now()-interval 1 year));
|
|
select day(s.yyyymmdd) as OK_1, last_day(s.yyyymmdd) as OK_2, day(last_day(s.yyyymmdd)) as OK_3 from my_innodb_tab s;
|
+------+------------+------+
|
| OK_1 | OK_2 | OK_3 |
|
+------+------------+------+
|
| 21 | 2024-02-29 | 29 |
|
| 21 | 2023-02-28 | 28 |
|
+------+------------+------+
|
|