[MDEV-9972] Least function retuns date in date time format Created: 2016-04-22  Updated: 2016-06-08  Resolved: 2016-06-08

Status: Closed
Project: MariaDB Server
Component/s: Temporal Types
Affects Version/s: 5.5.49
Fix Version/s: 5.5.50

Type: Bug Priority: Major
Reporter: Marc Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None
Environment:

mysql Ver 15.1 Distrib 5.5.49-MariaDB, for Linux (x86_64) using readline 5.1


Issue Links:
PartOf
is part of MDEV-9521 Least function returns 0000-00-00 for... Closed
Sprint: 5.5.50

 Description   

Hi,

This a follow up to MDEV-9521. the NULL value is returned as expected now but format of date still appears as date_time even if columns are date type.

Same test case as MDEV-9521 , query now returns:

+----+------------+---------------------+
| id | date_debut | date_fin            |
+----+------------+---------------------+
|  1 | 2016-01-01 | 2016-01-31 00:00:00 |
|  2 | 2016-02-01 | 2016-01-28 00:00:00 |
|  3 | 2016-03-01 | 2016-03-31 00:00:00 |
|  4 | 2016-04-01 | NULL                |
+----+------------+---------------------+

This is still not the same as 5.5.44.



 Comments   
Comment by Elena Stepanova [ 2016-04-22 ]

Apparently, in scope of MDEV-9521 only the NULL part was fixed, while the date(time) format part was missed. Sorry about that.

Comment by Jiri Kavalik [ 2016-06-08 ]

Hello elenst,

in http://dba.stackexchange.com/questions/140023/least-with-if-condition-brings-timestamp-instead-of-date the OP says that something similar happens in 10.0.22 too. I asked them to report it with their test case but they unfortunatelly never did. So I checked the test case from MDEV-9521 on 10.0.24 and got

+----+------------+---------------------+
| id | date_debut | date_fin            |
+----+------------+---------------------+
|  1 | 2016-01-01 | 2016-01-31 00:00:00 |
|  2 | 2016-02-01 | 2016-01-28 00:00:00 |
|  3 | 2016-03-01 | 2016-03-31 00:00:00 |
|  4 | 2016-04-01 | 0000-00-00 00:00:00 |
+----+------------+---------------------+

Comment by Alexander Barkov [ 2016-06-08 ]

Pushed into 5.5:
https://github.com/MariaDB/server/commit/a4848e975d2fe359ff354e767427c01dbe908037

Generated at Thu Feb 08 07:38:42 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.