[MDEV-9397] Split field.cc:calc_pack_length() into virtual methods in Type_handler 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: refactoring

Issue Links:
Blocks
blocks MDEV-4912 Data type plugin API version 1 Closed
Relates
relates to MDEV-12833 Split Column_definition::create_lengt... Closed

 Description   

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

@@ -9565,6 +9670,9 @@ enum_field_types get_blob_type_from_leng
 
 uint32 calc_pack_length(enum_field_types type,uint32 length)
 {
+  if (const Type_handler *handler= Type_handlers.handler(type))
+    return handler->calc_pack_length(length);
+
   switch (type) {
   case MYSQL_TYPE_VAR_STRING:
   case MYSQL_TYPE_STRING:
 



 Comments   
Comment by Alexander Barkov [ 2017-05-17 ]

Pushed to bb-10.2-ext

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