Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
Let's add a new class with approximately this definition:
|
class Type_collection |
{
|
public: |
virtual ~Type_collection() {} |
virtual const Type_handler *aggregate_for_result(const Type_handler *h1, |
const Type_handler *h2) |
const= 0; |
virtual const Type_handler *aggregate_for_comparison(const Type_handler *h1, |
const Type_handler *h2) |
const= 0; |
virtual const Type_handler *aggregate_for_min_max(const Type_handler *h1, |
const Type_handler *h2) |
const= 0; |
virtual const Type_handler *aggregate_for_num_op(const Type_handler *h1, |
const Type_handler *h2) |
const= 0; |
};
|
It will work as follows:
- Data type plugins will provide instances of Type_collection.
- Each Type_collection will contain one or more data types (Type_handler instances).
- Data types from the same Type_collection will "know" each other.
- If two data types are from the same collection, data type aggregation for various operations (i.e. result, comparson, LEAST/GREATES, numeric dyadic operators) will be delegated to their Type_collection through virtual methods.
For now there will be two collections:
- Type_collection_geometry, containing Type_handler_geometry.
- Type_collection_std, containing all other built-in data types.
Later, we'll split out geometry subtypes (POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION) into separate type handlers, so Type_collection_geometry will contain 8 type handlers
(the generic one, and handlers for 7 subtypes):
- Type_handler_geometry
- Type_handler_point
- Type_handler_linestring
- Type_handler_polygon
- Type_handler_multipoint
- Type_handler_multilinestring
- Type_handler_multipolygon
- Type_handler_geometrycollection
Later, we'll add Type_collection_json and will turn JSON functionality into handlers:
- Type_handler_varchar_json
- Type_handler_tinytext_json
- Type_handler_text_json
- Type_handler_mediumtext_json
- Type_handler_longtext_json
and remove Item::is_json_type().
Later, we'll add Type_collection_inet with two data type handlers:
- Type_handler_inet4
- Type_handler_inet6
Attachments
Issue Links
- blocks
-
MDEV-4912 Data type plugin API version 1
-
- Closed
-
-
MDEV-19923 Add type handlers for geometry sub-types
-
- Closed
-
Activity
issue.field.resolutiondate | 2019-06-29 18:01:06.0 | 2019-06-29 18:01:06.435 |
Fix Version/s | 10.5.0 [ 23709 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Link |
This issue blocks |
Description |
Let's add a new class with approximately this definition:
{code:cpp} class Type_collection { public: virtual ~Type_collection() {} virtual const Type_handler *aggregate_for_result(const Type_handler *h1, const Type_handler *h2) const= 0; virtual const Type_handler *aggregate_for_comparison(const Type_handler *h1, const Type_handler *h2) const= 0; virtual const Type_handler *aggregate_for_min_max(const Type_handler *h1, const Type_handler *h2) const= 0; virtual const Type_handler *aggregate_for_num_op(const Type_handler *h1, const Type_handler *h2) const= 0; }; {code} It will work as follows: - Data type plugins will provide instances of Type_collection. - Each Type_collation will contain one or more data types (Type_handler instances). - Data types from the same Type_collection will "know" each other. - If two data types are from the same collection, data type aggregation for various operations (i.e. result, comparson, LEAST/GREATES, numeric dyadic operators) will be delegated to their Type_collection through virtual methods. For now there will be two collections: - Type_collection_geometry, containing Type_handler_geometry. - Type_collection_std, containing all other built-in data types. Later, we'll split out geometry subtypes (POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION) into separate type handlers, so Type_collection_geometry will contain 8 type handlers (the generic one, and handlers for 7 subtypes): - Type_handler_geometry - Type_handler_point - Type_handler_linestring - Type_handler_polygon - Type_handler_multipoint - Type_handler_multilinestring - Type_handler_multipolygon - Type_handler_geometrycollection Later, we'll add Type_collection_json and will turn JSON functionality into handlers: - Type_handler_varchar_json - Type_handler_tinytext_json - Type_handler_text_json - Type_handler_mediumtext_json - Type_handler_longtext_json and remove Item::is_json_type(). Later, we'll add Type_collection_inet with two data type handlers: - Type_handler_inet4 - Type_handler_inet6 |
Let's add a new class with approximately this definition:
{code:cpp} class Type_collection { public: virtual ~Type_collection() {} virtual const Type_handler *aggregate_for_result(const Type_handler *h1, const Type_handler *h2) const= 0; virtual const Type_handler *aggregate_for_comparison(const Type_handler *h1, const Type_handler *h2) const= 0; virtual const Type_handler *aggregate_for_min_max(const Type_handler *h1, const Type_handler *h2) const= 0; virtual const Type_handler *aggregate_for_num_op(const Type_handler *h1, const Type_handler *h2) const= 0; }; {code} It will work as follows: - Data type plugins will provide instances of Type_collection. - Each Type_collection will contain one or more data types (Type_handler instances). - Data types from the same Type_collection will "know" each other. - If two data types are from the same collection, data type aggregation for various operations (i.e. result, comparson, LEAST/GREATES, numeric dyadic operators) will be delegated to their Type_collection through virtual methods. For now there will be two collections: - Type_collection_geometry, containing Type_handler_geometry. - Type_collection_std, containing all other built-in data types. Later, we'll split out geometry subtypes (POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION) into separate type handlers, so Type_collection_geometry will contain 8 type handlers (the generic one, and handlers for 7 subtypes): - Type_handler_geometry - Type_handler_point - Type_handler_linestring - Type_handler_polygon - Type_handler_multipoint - Type_handler_multilinestring - Type_handler_multipolygon - Type_handler_geometrycollection Later, we'll add Type_collection_json and will turn JSON functionality into handlers: - Type_handler_varchar_json - Type_handler_tinytext_json - Type_handler_text_json - Type_handler_mediumtext_json - Type_handler_longtext_json and remove Item::is_json_type(). Later, we'll add Type_collection_inet with two data type handlers: - Type_handler_inet4 - Type_handler_inet6 |
Workflow | MariaDB v3 [ 97866 ] | MariaDB v4 [ 134021 ] |