[MDEV-5718] Inconsistent between implicit and explicit conversion from DATETIME to TIME Created: 2014-02-23 Updated: 2022-09-08 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.3.12, 5.5.35, 10.0.8 |
| Fix Version/s: | 5.5 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
There is a difference between explicit and implicit DATETIME->TIME conversion when using a datetime with zero YYYYMM and a non-zero day:
Notice, implicit conversion adds days to hours, while explicit does not. The problem also presents in the upstream. The same problem is repeatable when casting a DATETIME column to TIME.
Note, if I now ALTER the DATETIME column to TIME, it does mix days to hours:
This is inconsistent. Conversion should work the same way in all cases:
In 10.3 (as of 2018-02-07) implicit conversion from DATETIME to TIME at INSERT time and explicit conversion at ALTER time work as follows:
There are two options: Sergei is included towards #2. |
| Comments |
| Comment by Sergei Golubchik [ 2014-02-23 ] |
|
what versions are affected? |