Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
Description
As a part of preparatory work for MDEV-4912, we'll add a new virtual method in Type_handler:
virtual Item_cache *Item_get_cache(THD *thd, const Item *item) const; |
and split this code into implementations of the new virtual method:
Item_cache* Item_cache::get_cache(THD *thd, const Item *item, |
const Item_result type) |
{
|
MEM_ROOT *mem_root= thd->mem_root;
|
switch (type) { |
case INT_RESULT: |
return new (mem_root) Item_cache_int(thd, item->field_type()); |
case REAL_RESULT: |
return new (mem_root) Item_cache_real(thd); |
case DECIMAL_RESULT: |
return new (mem_root) Item_cache_decimal(thd); |
case STRING_RESULT: |
return new (mem_root) Item_cache_str(thd, item); |
case ROW_RESULT: |
return new (mem_root) Item_cache_row(thd); |
case TIME_RESULT: |
return new (mem_root) Item_cache_temporal(thd, item->field_type()); |
}
|
return 0; // Impossible |
}
|
This will allow data type plugins to create their own versions of Item_cache, to optimize comparison with constants.
Attachments
Issue Links
- blocks
-
MDEV-4912 Data type plugin API version 1
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
As a part of preparatory work for {code:cpp} virtual Item_cache *Item_get_cache(THD *thd, const Item *item) const; {code} and split this code into implementations of the new virtual method: {code:cpp} Item_cache* Item_cache::get_cache(THD *thd, const Item *item, const Item_result type) { MEM_ROOT *mem_root= thd->mem_root; switch (type) { case INT_RESULT: return new (mem_root) Item_cache_int(thd, item->field_type()); case REAL_RESULT: return new (mem_root) Item_cache_real(thd); case DECIMAL_RESULT: return new (mem_root) Item_cache_decimal(thd); case STRING_RESULT: return new (mem_root) Item_cache_str(thd, item); case ROW_RESULT: return new (mem_root) Item_cache_row(thd); case TIME_RESULT: return new (mem_root) Item_cache_temporal(thd, item->field_type()); } return 0; // Impossible } {code} |
As a part of preparatory work for {code:cpp} virtual Item_cache *Item_get_cache(THD *thd, const Item *item) const; {code} and split this code into implementations of the new virtual method: {code:cpp} Item_cache* Item_cache::get_cache(THD *thd, const Item *item, const Item_result type) { MEM_ROOT *mem_root= thd->mem_root; switch (type) { case INT_RESULT: return new (mem_root) Item_cache_int(thd, item->field_type()); case REAL_RESULT: return new (mem_root) Item_cache_real(thd); case DECIMAL_RESULT: return new (mem_root) Item_cache_decimal(thd); case STRING_RESULT: return new (mem_root) Item_cache_str(thd, item); case ROW_RESULT: return new (mem_root) Item_cache_row(thd); case TIME_RESULT: return new (mem_root) Item_cache_temporal(thd, item->field_type()); } return 0; // Impossible } {code} This will allow data type plugins to create their own versions of Item_cache, to optimize comparison with constants. |
Status | Open [ 1 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Assignee | Alexander Barkov [ bar ] | Oleksandr Byelkin [ sanja ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Assignee | Oleksandr Byelkin [ sanja ] | Alexander Barkov [ bar ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Fix Version/s | 10.3.0 [ 22127 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Labels | datatype |
Workflow | MariaDB v3 [ 78459 ] | MariaDB v4 [ 133010 ] |
Reviewed and approved by Sanja.