[MDEV-11528] Split Item_func_min_max::val_xxx() and Item_func_min_max::get_date() into methods in Type_handler Created: 2016-12-10  Updated: 2017-04-07  Resolved: 2016-12-31

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Fix Version/s: 10.3.0

Type: Task Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: datatype

Issue Links:
Blocks
blocks MDEV-4912 Data type plugin API version 1 Closed

 Description   

Under term of this tasks we'll remove tests for cmp_type() and result_type() in Item_func_min_max::val_xxx() and Item_func_min_max::get_date() and introduce instead new methods in Type_handler, e.g.:

class Type_handler
{
  ...
  virtual
  String *Item_func_min_max_val_str(Item_func_min_max *,
                                    String *) const;
}

The methods Item_func_hybrid_min_max::val_xxx() and Item_func_min_max::get_date() will call the corresponding new methods in Type_handler:

class Item_func_min_max: public Item_hybrid_func
{
  ...
  String *val_str(String*str)
  {
    return Item_func_min_max::type_handler()->
             Item_func_min_max_val_str(this, str);
  }
  ...
}

For performance purposes, the change should try not to introduce new virtual calls.
One virtual call for xxx_type() should be replaced to one virtual call in Type_handler.
All possible calls inside the new methods should be done statically.



 Comments   
Comment by Alexander Barkov [ 2016-12-31 ]

Pushed into bb-10.2-ext and 10.3

Generated at Thu Feb 08 07:50:39 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.