[MDEV-12514] Split Item_temporal_func::fix_length_and_dec() Created: 2017-04-17 Updated: 2017-04-19 Resolved: 2017-04-19 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Temporal Types |
| Fix Version/s: | 10.3.1 |
| Type: | Task | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Alexander Barkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | datatype | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Description |
|
We're anticipating the following additions and changes soon:
The intent of this task is to make item_timefunc.h and item_timefunc.cc more ready for the mentioned tasks. This task will include the following changes: 1. The key point is to get rid of the generic Item_temporal_func::fix_length_and_dec and particular of this code:
which is not friendly to adding new data types.
2. The classes Item_date_add_interval, Item_func_add_time, Item_func_str_to_date (implementing temporal hybrid functions DATE_ADD(), ADD_TIME(), STR_TO_DATE()) will become descendants of Item_hybrid_func, so later we can add support for the INTERVAL and TIMESTAMP WITH TIME ZONE data types easier, e.g. reuse the get_value() related infrastructure. In order to do this we'll derive Item_temporal_hybrid_func from Item_hybrid_func rather than Item_temporal_func. Note, in the current implementation, Item_temporal_hybrid_func descendants use the inherited method Item_temporal_func::save_in_field() which uses save_date_in_field() even if the return data type is VARCHAR. This is wrong. See 3. The function mysql_temporal_int_part_length() will be removed. 4. Expressions of the GEOMETRY type (and its variants such as POINT) will be disallowed as arguments to DATE_ADD(), ADDTIME() and STR_TO_DATE(). This will be a similar change to those that we earlier did for other hybrid functions (e.g. in
They we'll be added later, when new reasonable data type pairs appear. For now we'll just return an error for all non-traditional types (with GEOMETRY being the only one non-traditional type at this point). |
| Comments |
| Comment by Alexander Barkov [ 2017-04-19 ] |
|
Pushed to bb-10.2-ext and 10.3 |