[MDEV-17740] Extend EXTRACT(x AS DAY*) to understand long time intervals Created: 2018-11-16 Updated: 2018-11-20 Resolved: 2018-11-17 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Temporal Types |
| Fix Version/s: | 10.4.1 |
| Type: | Task | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Earlier This task is to make EXTRACT(x AS *) understand long time intervals as well, for consistency. We'll change EXTRACT(x AS *) to parse some input formats as time interval, instead of DATE or TIME. Note, this change will affect only units starting with DAY*, HOUR*, MINUTE*, SECOND*, MICROSECOND*. Examples of literal that will be parsed as time interval rather than DATE or TIME:
For example, in this script:
the new EXTRACT() will return these results:
Note, the current behavior returns this result:
Note, behavior of these functions won't change:
They are MySQL compatibility functions and return different results comparing to the corresponding EXTRACT(unit FROM x). We won't touch them in this MDEV. |