[MDEV-9219] Split rpl_utility.cc:can_convert_field_to() into a virtual method in Type_handler Created: 2015-12-01  Updated: 2021-05-11

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Major
Reporter: Alexander Barkov Assignee: Unassigned
Resolution: Unresolved Votes: 1
Labels: refactoring

Issue Links:
PartOf
is part of MDEV-19710 Split the server side code in rpl_uti... Closed
Epic Link: Data type cleanups

 Description   

In order to make built-in and pluggable data types look similar inside the server code, we'll split this function:

static bool
can_convert_field_to(Field *field,
                     enum_field_types source_type, uint16 metadata,
                     Relay_log_info *rli, uint16 mflags,
                     int *order_var)
{
...
}

into type-specific implementations of a new virtual method in Type_handler.

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

--- sql/rpl_utility.cc  2014-05-13 09:53:30 +0000
+++ sql/rpl_utility.cc  2014-06-27 15:48:45 +0000
@@ -675,6 +675,9 @@ can_convert_field_to(Field *field,
   */
 
   DBUG_PRINT("debug", ("Base types are different, checking conversion"));
+  if (Type_handlers.handler(source_type))
+    DBUG_RETURN(false);


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