[MDEV-20042] Implement EXTRA2_FIELD_DATA_TYPE_INFO in FRM Created: 2019-07-11  Updated: 2019-10-02  Resolved: 2019-07-11

Status: Closed
Project: MariaDB Server
Component/s: Data types
Fix Version/s: 10.5.0

Type: Task Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-4912 Data type plugin API version 1 Closed
blocks MDEV-15558 Save real data type in addition to ex... Open

 Description   

This task will implement a new frm segment EXTRA2_FIELD_DATA_TYPE_INFO.
Pluggable data types will write their exact data type information in this segment: the data type name and all attributes.

In the standard data type sergment, pluggable data types will still write basic things (like normal fields do) such as:

  • The MYSQL_TYPE_XXX replacement type code
  • Decimals
  • Length
  • Collation ID
  • Flags

For example, INET6 will later write this information in the standard segment:

  • Type code = MYSQL_TYPE_STRING
  • Field length = 16
  • Collation ID = 63 (my_charset_bin)

and additionally write "inet6" into the new segment EXTRA2_FIELD_DATA_TYPE_INFO.

Only extended data types will write to EXTRA2_FIELD_DATA_TYPE_INFO.
If a table does not have any columns with extended types, EXTRA2_FIELD_DATA_TYPE_INFO won't be written.

Let's use this format for every field:

1. fieldnr, in net_write_length() format
2. data type info length, in net_write_length() format
3. data type info string, according to 2

We don't have extended data types yet, so this task will make sure the new functionality works using some DBUG_EXECUTE_IFs:

  • to force some built-in data types write EXTRA2_FIELD_DATA_TYPE_INFO
  • to print information about EXTRA2_FIELD_DATA_TYPE_INFO as warnings

This will guarantee that the full cycle is tested:

  • writing EXTRA2_FIELD_DATA_TYPE_INFO in build_frm_image()
  • parsing EXTRA2_FIELD_DATA_TYPE_INFO in TABLE_SHARE::init_from_binary_frm_image()

Generated at Thu Feb 08 08:56:17 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.