Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
Description
Under term of this tasks we'll remove switch(cmp_type()) in Item_func_hybrid_field_type::val_xxx() and Item_func_hybrid_field_type::get_date() and introduce instead new methods in Type_handler, e.g.:
class Type_handler |
{
|
...
|
virtual |
String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *,
|
String *) const= 0;}; |
}
|
The methods Item_func_hybrid_field_type::val_xxx() and Item_func_hybrid_field_type::get_date() will call the corresponding new methods in Type_handler:
class Item_func_hybrid_field_type: public Item_hybrid_func |
{
|
...
|
String *val_str(String*str)
|
{
|
return Item_func_hybrid_field_type::type_handler()-> |
Item_func_hybrid_field_type_val_str(this, str); |
}
|
...
|
}
|
For performance purposes, the change should try not to introduce new virtual calls.
One virtual call in switch(cmp_type()) should be replaced to one virtual call in Type_handler.
Calls inside the new methods in Type_handler should be done statically.
Attachments
Issue Links
- blocks
-
MDEV-4912 Data type plugin API version 1
-
- Closed
-
Activity
Affects Version/s | 10.3 [ 22126 ] | |
Issue Type | Bug [ 1 ] | Task [ 3 ] |
Description |
Under term of this tasks we'll remove switch(cmp_type()) in Item_func_hybrid_field_type::val_xxx() and Item_func_hybrid_field_type::get_date() and introduce instead new methods in Type_handler, e.g.:
{code:cpp} class Type_handler { ... virtual String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *, String *) const= 0;}; } {code} The methods Item_func_hybrid_field_type::val_xxx() and Item_func_hybrid_field_type::get_date() will call the corresponding new methods in Type_handler: {code:cpp} class Item_func_hybrid_field_type: public Item_hybrid_func { ... String *val_str(String*str) { return Item_func_hybrid_field_type::type_handler()-> Item_func_hybrid_field_type_val_str(this, str); } ... } {code} For performance purposes, the change should try not to introduce new virtual calls. One virtual call in switch(cmp_type()) should be replaced to one virtual call in Type_handler. Calls inside the new methods in Type_handler should be done statically. |
Under term of this tasks we'll remove {{switch(cmp_type())}} in {{Item_func_hybrid_field_type::val_xxx()}} and {{Item_func_hybrid_field_type::get_date()}} and introduce instead new methods in {{Type_handler}}, e.g.:
{code:cpp} class Type_handler { ... virtual String *Item_func_hybrid_field_type_val_str(Item_func_hybrid_field_type *, String *) const= 0;}; } {code} The methods {{Item_func_hybrid_field_type::val_xxx()}} and {{Item_func_hybrid_field_type::get_date()}} will call the corresponding new methods in {{Type_handler}}: {code:cpp} class Item_func_hybrid_field_type: public Item_hybrid_func { ... String *val_str(String*str) { return Item_func_hybrid_field_type::type_handler()-> Item_func_hybrid_field_type_val_str(this, str); } ... } {code} For performance purposes, the change should try not to introduce new virtual calls. One virtual call in {{switch(cmp_type())}} should be replaced to one virtual call in {{Type_handler}}. Calls inside the new methods in {{Type_handler}} should be done statically. |
Status | Open [ 1 ] | In Progress [ 3 ] |
Assignee | Alexander Barkov [ bar ] | Vicentiu Ciorbaru [ cvicentiu ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Assignee | Vicentiu Ciorbaru [ cvicentiu ] | Alexander Barkov [ bar ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
issue.field.resolutiondate | 2016-12-05 12:31:49.0 | 2016-12-05 12:31:49.716 |
Fix Version/s | 10.3.0 [ 22127 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Closed [ 6 ] |
Labels | datatype |
Workflow | MariaDB v3 [ 78414 ] | MariaDB v4 [ 133005 ] |
I've also reviewed
MDEV-10811in the process of reviewing this patch. After discussing not to use casts that lead to undefined behaviour, we've agreed on an implementation.