[MDEV-12506] Split Item_func_min_max::fix_length_and_dec() into methods in Type_handler Created: 2017-04-14 Updated: 2017-04-22 Resolved: 2017-04-22 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| 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 |
|
Item_func_min_max::fix_length_and_dec() is hard-coded for the built-in data types. To allow pluggable data type determine behavior of the functions LEAST and GREATEST, we'll move the code to Type_handler as follows: 1. Add a new method in Type_handler_hybrid_field_type:
This method will decide which data type handler should be used for the result of LEAST/GREATEST. 2. Add a new virtual method in Type_handler:
This method will calculate the data type attributes. See Type_std_attributes. Note, implementations for the particular Type_handler_xxx classes should reuse the code from Item_hybrid_func_fix_attributes as much as possible, because the current implementation of Item_func_min_max::fix_length_and_dec() is quite buggy:
Sharing the code with Item_hybrid_func should fix these problems. 3. Remove the current implementation of Item_func_min_max::fix_length_and_dec() and replace it to the new methods. Under terms of this task we'll also disallow LEAST and GREATEST to have arguments of the GEOMETRY data type mixed with numeric and temporal arguments, as this has no sense. |
| Comments |
| Comment by Alexey Botchkov [ 2017-04-22 ] |
|
Ok to push. |
| Comment by Alexander Barkov [ 2017-04-22 ] |
|
Pushed to bb-10.2-ext |