[MDEV-4913] External ENUM Field definition Created: 2013-08-17  Updated: 2019-11-19

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

Type: Task Priority: Minor
Reporter: roberto spadim Assignee: Unassigned
Resolution: Unresolved Votes: 2
Labels: None

Issue Links:
Blocks
is blocked by MDEV-4912 Data type plugin API version 1 Closed
Epic Link: New data types

 Description   

Based in a table, KEY-VALUE, we could expand the ENUM field from limited size (65535 values) to a unlimited size (64bits), this is a new field type

ENUM_EXTERNAL(database,table,key column,value column)

the internal value of ENUM_EXTERNAL is a bigint, the string representation is a blob (or maybe a varchar(255) or a text)

the point is:

the storage engine will save a bitint
the mysql core will convert the STRING to BIGINT using the database/table/key column/value, using a SELECT like this:

SELECT <value_column> FROM <database>.<table> WHERE <value_column>="FIELD VALUE SEND VIA INSERT/UPDATE/DELETE"
UNION
SELECT <key_column> FROM <database>.<table> WHERE <key_column>="FIELD VALUE SEND VIA INSERT/UPDATE/DELETE"
LIMIT 1

this solve the problem of .FRM file don't allowing a big definition of ENUM/SET, and add an feature to developer of an avoid of alter table to change enum definition (it can use the external table to define the key-values of enum)



 Comments   
Comment by Patryk Pomykalski [ 2013-08-17 ]

Why wouldn't you just use an int/bigint column and a dictionary table by yourself? Why complicate the server code?

Comment by roberto spadim [ 2013-08-17 ]

hi patryk,
no problem to do this in a dictionary table, but i will do it when a field
plugin could be used, the today implementation of enum use memory to solve
the string -> number 'conversion', i want to use disk (storage engine) to
do this
yes it a developer/dba table design problem, but if it's possible could be
nice implement it at server
check the idea of https://mariadb.atlassian.net/browse/MDEV-4912

i will make this one as blocked by mdev-4912, this will remove problems
about 'complicate' the server code, the problem will be changed to 'plugin
code'

2013/8/17 Patryk Pomykalski (JIRA) <jira@mariadb.atlassian.net>


Roberto Spadim
SPAEmpresarial

Comment by roberto spadim [ 2013-08-17 ]

hi patryk,

check that the idea of MDEV-4912, will solve the problem of two others
MDEV...
i think we could implement the plugin first, and all others considerations
about field types could be solved via this interface, only the "native
field types" should be implmented at "server-side" code (not the "plugin"
code)

https://mariadb.atlassian.net/browse/MDEV-4631 - Encrypted column data type
https://mariadb.atlassian.net/browse/MDEV-274 - The data type for IPv6/IPv4
addresses in MariaDB

and the enum could be used as theses mdevs too
https://mariadb.atlassian.net/browse/MDEV-4913 - External ENUM Field
definition

what you think?
i was talking about this at maria-developer mail list with Sergei Golubchik
(the plugin, not the external enum field type)

Comment by roberto spadim [ 2013-08-29 ]

please add this to 10.1.0 version

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