Issues to solve:
- read/write: that's easy, the plugin provides some kind of a "store" method that serializes the data into something that can be memcmp-ed. And "val" methods as appropriate.
- indexing: not at issue, the engine thinks the column type is BINARY and indexes is accordingly
- don't forget that field definition may use parameters, like in VARCHAR(10)
- text protocol - what to send as field metadata? variant: MYSQL_TYPE_PLUGIN and a string with the type name
- binary protocol - how to send the value to the client: variant: as a string. how the client send the value to the server? either way, the server converts it from number/string/etc just as for INSERTs
- replication, RBR
- similar, use MYSQL_TYPE_PLUGIN, and as additional metadata - field type as a string, parameters, whatever
So, a plugin would need to provide
- store() method from at least some of the basic types
- val() methods to at least some of the basic types
- description of whatever parameters a field definition takes
- informational methods, like store_length(), etc
This task doesn't cover everything! It is assumed that we can expand this API later to add more features. In particular, the following is not solved:
- data types that cannot be efficiently memcmp()'ed. For example, this proposal doesn't allow to implement a string type with charset support.
- data types that require special indexes, such as XML, spatial data, etc.
see also the original issue description in the history