[MDEV-11615] Split Item_hybrid_func::fix_attributes into virtual methods in Type_handler Created: 2016-12-20  Updated: 2017-04-07  Resolved: 2016-12-27

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   

This task will add a new virtual method in Type_handler:

  virtual bool Item_hybrid_func_fix_attributes(THD *thd, Item_hybrid_func *func,
                                               Item **items,
                                               uint nitems) const;

and split this code in Item_hybrid_func::fix_attributes into the new method implementation in the relevant type handler implementations:

 switch (Item_hybrid_func::result_type()) {
 case STRING_RESULT:
 ..
 case DECIMAL_RESULT:
  ..
 case REAL_RESULT:
 ..
 case INT_RESULT:
 ..
 case ROW_RESULT:
 case TIME_RESULT:
 ..
 }

and also remove a special STRING_RESULT condition in Item_func_case::fix_length_and_dec(), to make the code symmetric across the data types.

Note, the THD* parameter to Type_handler::Item_hybrid_func_fix_attributes is not needed right now, but it will be needed soon:

  • for MDEV-10575
  • to get rid of current_thd calls inside count_string_length(), as it was planned to get rid of most current_thd calls in 10.3.


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

Pushed into bb-10.2-ext, merged to 10.3.

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