[MDEV-9398] Add Type_handler::cast_to_int_type Created: 2016-01-11  Updated: 2017-05-17  Resolved: 2017-05-17

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, refactoring

Issue Links:
Blocks
blocks MDEV-4912 Data type plugin API version 1 Closed
Relates
relates to MDEV-12426 Add Field::type_handler() Closed

 Description   

The relevant pieces of the code in the original type handler patch:

@@ -512,6 +514,11 @@ class Item_func_hybrid_field_type :publi
     cached_field_type(MYSQL_TYPE_DOUBLE)
   {}
   enum_field_types field_type() const { return cached_field_type; }
+  Item_result cast_to_int_type() const
+  {
+    const Type_handler *handler= Type_handlers.handler(field_type());
+    return handler ? handler->cast_to_int_type() : cmp_type();
+  }

@@ -1071,9 +1080,15 @@ class Item_func_min_max :public Item_fun
+  Item_result cast_to_int_type() const
+  {
+    const Type_handler *handler= Type_handlers.handler(field_type());
+    return handler ? handler->cast_to_int_type() : Item_func::cmp_type();
+  }
 };


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