[MDEV-16938] Move Item::get_time_with_conversion() to Time Created: 2018-08-11 Updated: 2018-08-11 Resolved: 2018-08-11 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data types, Temporal Types |
| Fix Version/s: | 10.4.0 |
| Type: | Task | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
There is a code responsible equal constant propagation which includes:
This code makes automatic conversion from DATETIME to TIME in a special way, with handling of OLD_MODE_ZERO_DATE_TIME_CAST.
This is different from how TIME is constructed from DATETIME
For To have an instance of Time easier, we'll move the mentioned code from The code in Time() constructors already has the logic for DATETIME to TIME conversion, so Item::get_time_with_conversion() duplicates it in some extent. However, it misses propagation-specific conversion features. In order to implement the desired behavior inside the Time() constructor, two new modes will be added into Time::datetime_to_time_mode_t:
so it will look like this:
The old methods and functions will be removed:
The calculation of (DATETIME-CURRENT_DATE) will migrate into a new method in Time, approximately like this:
|