Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
Description
In order to make built-in and pluggable data types look similar inside the server, this function should be split into a new virtual method in Type_handler:
Field *make_field(TABLE_SHARE *share,
|
MEM_ROOT *mem_root,
|
uchar *ptr, uint32 field_length,
|
uchar *null_pos, uchar null_bit,
|
uint pack_flag,
|
enum_field_types field_type,
|
CHARSET_INFO *field_charset,
|
Field::geometry_type geom_type, uint srid,
|
Field::utype unireg_check,
|
TYPELIB *interval,
|
const char *field_name)
|
The relevant piece of the code in the original type handler patch:
@@ -9721,6 +9829,14 @@ Field *make_field(TABLE_SHARE *share, uc
|
}
|
}
|
|
+ if (const Type_handler *handler= Type_handlers.handler(field_type))
|
+ {
|
+ Field::Create_param param(share, ptr,
|
+ field_length, null_pos, null_bit, pack_flag, field_charset,
|
+ geom_type, unireg_check, interval);
|
+ return handler->make_field(¶m, field_name);
|
+ }
|
+
|
A tentative new virtual Type_handler method prototype:
virtual Field *
|
make_table_field_from_def(TABLE_SHARE *share,
|
MEM_ROOT *mem_root,
|
const LEX_CSTRING *name, |
const Record_addr *addr,
|
const Bit_addr *bit, |
const Column_definition_attributes *attr,
|
uint32 flags) const= 0;
|
where:
- Bit_addr is a new class representing the position and the offset of the extra bits (e.g. for the BIT(N) data type)
- Column_definition_attributes is a new class collecting all attribute parameters:
class Column_definition_attributes |
{
|
public: |
ulonglong length;
|
Field::utype unireg_check;
|
TYPELIB *interval;
|
CHARSET_INFO *charset;
|
uint32 srid;
|
Field::geometry_type geom_type;
|
uint pack_flag;
|
...
|
// methods |
...
|
};
|
|
Attachments
Issue Links
- blocks
-
MDEV-4912 Data type plugin API version 1
- Closed
- is blocked by
-
MDEV-16280 Add class Bit_addr
- Closed