Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
Description
Item_func_hex::val_str_ascii() has a few tests on args[0]->result_type().
if (args[0]->result_type() == REAL_RESULT || |
args[0]->result_type() == DECIMAL_RESULT)
|
We'll move the data type specific code to the corresponding Type_handler_xxx, and rewrite Item_func_hex::val_str_ascii() to call a virtual method in Type_handler, e.g. about like this:
String *val_str_ascii(String *str)
|
{
|
return args[0]->type_handler()->Item_func_hex_val_str_ascii(this, str); |
}
|
Note, the value of args[0]->type_handler() can be cached at fix_length_and_dec() time, to have fewer virtual calls at run time:
String *val_str_ascii(String *str)
|
{
|
return m_handler->Item_func_hex_val_str_ascii(this, str); |
}
|
Attachments
Issue Links
- blocks
-
MDEV-4912 Data type plugin API version 1
-
- Closed
-
Activity
Status | Open [ 1 ] | In Progress [ 3 ] |
Description |
{{Item_func_hex::val_str_ascii()}} has a few tests on {{args[0]->result_type()}}.
{code} if (args[0]->result_type() == REAL_RESULT || args[0]->result_type() == DECIMAL_RESULT) {code} We'll move the data type specific code to the corresponding {{Type_handler_xxx}}, and rewrite {{Item_func_hex::val_str_ascii()}} to call a virtual method in {{Type_handler}}, e.g. about like this: {code} String *val_str_ascii(String *str) { return args[0]->type_handler()->Item_func_hex_val_str_ascii(this, str); } {code} Note, the value of {{args[0]->type_handler()}} can be cached at {{fix_length_and_dec()}} time, to less fewer virtual calls at run time: {code} String *val_str_ascii(String *str) { return m_handler->Item_func_hex_val_str_ascii(this, str); } {code} |
{{Item_func_hex::val_str_ascii()}} has a few tests on {{args[0]->result_type()}}.
{code:cpp} if (args[0]->result_type() == REAL_RESULT || args[0]->result_type() == DECIMAL_RESULT) {code} We'll move the data type specific code to the corresponding {{Type_handler_xxx}}, and rewrite {{Item_func_hex::val_str_ascii()}} to call a virtual method in {{Type_handler}}, e.g. about like this: {code:cpp} String *val_str_ascii(String *str) { return args[0]->type_handler()->Item_func_hex_val_str_ascii(this, str); } {code} Note, the value of {{args[0]->type_handler()}} can be cached at {{fix_length_and_dec()}} time, to less fewer virtual calls at run time: {code:cpp} String *val_str_ascii(String *str) { return m_handler->Item_func_hex_val_str_ascii(this, str); } {code} |
Description |
{{Item_func_hex::val_str_ascii()}} has a few tests on {{args[0]->result_type()}}.
{code:cpp} if (args[0]->result_type() == REAL_RESULT || args[0]->result_type() == DECIMAL_RESULT) {code} We'll move the data type specific code to the corresponding {{Type_handler_xxx}}, and rewrite {{Item_func_hex::val_str_ascii()}} to call a virtual method in {{Type_handler}}, e.g. about like this: {code:cpp} String *val_str_ascii(String *str) { return args[0]->type_handler()->Item_func_hex_val_str_ascii(this, str); } {code} Note, the value of {{args[0]->type_handler()}} can be cached at {{fix_length_and_dec()}} time, to less fewer virtual calls at run time: {code:cpp} String *val_str_ascii(String *str) { return m_handler->Item_func_hex_val_str_ascii(this, str); } {code} |
{{Item_func_hex::val_str_ascii()}} has a few tests on {{args[0]->result_type()}}.
{code:cpp} if (args[0]->result_type() == REAL_RESULT || args[0]->result_type() == DECIMAL_RESULT) {code} We'll move the data type specific code to the corresponding {{Type_handler_xxx}}, and rewrite {{Item_func_hex::val_str_ascii()}} to call a virtual method in {{Type_handler}}, e.g. about like this: {code:cpp} String *val_str_ascii(String *str) { return args[0]->type_handler()->Item_func_hex_val_str_ascii(this, str); } {code} Note, the value of {{args[0]->type_handler()}} can be cached at {{fix_length_and_dec()}} time, to have fewer virtual calls at run time: {code:cpp} String *val_str_ascii(String *str) { return m_handler->Item_func_hex_val_str_ascii(this, str); } {code} |
Assignee | Alexander Barkov [ bar ] | Alexey Botchkov [ holyfoot ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Assignee | Alexey Botchkov [ holyfoot ] | Alexander Barkov [ bar ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
issue.field.resolutiondate | 2016-12-01 07:59:12.0 | 2016-12-01 07:59:12.394 |
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 [ 78323 ] | MariaDB v4 [ 133003 ] |