[MDEV-12707] Split resolve_const_item() into virtual methods in Type_handler Created: 2017-05-05  Updated: 2017-05-05  Resolved: 2017-05-05

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Fix Version/s: 10.3.1

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

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

 Description   

resolve_const_item() is not friendly to pluggable data types, as it has:

  • A switch on the result of item_cmp_type()
  • A call for field_type_for_temporal_comparison()

This is hard-coded for built-in data types only and won't work properly for new data types.

We'll do the following:

  • Introduce a new method in Type_handler:

    virtual Item *make_const_item_for_comparison(THD *thd,
                                                 Item *src,
                                                 Item *comparand) const= 0;
    

  • Split the code in resolve_const_item() into virtual implementations of the proper type handler implementations
  • Replace item_cmp_type() to Type_handler_hybrid_field_type::aggregate_for_comparison()
  • Remove Item::field_type_for_temporal_comparison(), as it won't be used any more in the server code.

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