Details
-
Task
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Duplicate
-
None
Description
spider_db_mbase_util::open_item_func() is a so-called monster function. It is difficult to maintain while it is expected that we need to modify it when a new SQL function or a new func_type is added.
spider_db_mbase_util::open_item_func(Item_func *item_func, ...) breaks almost every time new Item_func::Functyp} is added (e.g.,.MDEV-24760,MDEV-24517). A possible solution would be removeing the default case and enable -Wswitch- Split the function into two different functions: one handles the case of str != NULL and the other handles the case of str == NULL.
NOTE: You don't need to make everything ideal at once, and it's impossible to do that with complex middleware like databases. Refactor only to the extent that you are sure it is safe to do so without additional unit tests.
Attachments
Issue Links
- blocks
-
MDEV-29447 SIGSEGV in spider_db_open_item_field and SIGSEGV in spider_db_print_item_type, on SELECT
-
- Closed
-
- relates to
-
MDEV-26208 Add unit tests for spider_db_mbase_util::open_item_func()
-
- Closed
-
-
MDEV-30504 Further refactoring of spider_db_mbase_util::open_item_func
-
- Open
-
Activity
Field | Original Value | New Value |
---|---|---|
Summary | Refactor spider_db_mbase_util::open_item_func() to make it maintenable | Refactor spider_db_mbase_util::open_item_func() |
Description | {{spider_db_mbase_util::open_item_func()}} is a so-called monster function. It is difficult to maintain while it is expected that we need to modify it when a new function or a new func_type is added. | {{spider_db_mbase_util::open_item_func()}} is a so-called monster function. It is difficult to maintain while it is expected that we need to modify it when a new function or a new func_type is added. If possible, I'd like to include unit tests for the function. |
Description | {{spider_db_mbase_util::open_item_func()}} is a so-called monster function. It is difficult to maintain while it is expected that we need to modify it when a new function or a new func_type is added. If possible, I'd like to include unit tests for the function. |
{{spider_db_mbase_util::open_item_func()}} is a so-called monster function. It is difficult to maintain while it is expected that we need to modify it when a new function or a new func_type is added. If possible, I'd like to include unit tests for the function.
* {{spider_db_mbase_util::open_item_func(Item_func *item_func, ...)}} breaks almost every time new {{Item_func::Functype}} is added (e.g., * (other refactoring here) |
Description |
{{spider_db_mbase_util::open_item_func()}} is a so-called monster function. It is difficult to maintain while it is expected that we need to modify it when a new function or a new func_type is added. If possible, I'd like to include unit tests for the function.
* {{spider_db_mbase_util::open_item_func(Item_func *item_func, ...)}} breaks almost every time new {{Item_func::Functype}} is added (e.g., * (other refactoring here) |
{{spider_db_mbase_util::open_item_func()}} is a so-called monster function. It is difficult to maintain while it is expected that we need to modify it when a new function or a new func_type is added.
* {{spider_db_mbase_util::open_item_func(Item_func *item_func, ...)}} breaks almost every time new {{Item_func::Functype}} is added (e.g., * (other refactoring here) |
Link |
This issue blocks |
Component/s | Storage Engine - Spider [ 10132 ] |
Epic Link | MDEV-26286 [ 101691 ] |
Description |
{{spider_db_mbase_util::open_item_func()}} is a so-called monster function. It is difficult to maintain while it is expected that we need to modify it when a new function or a new func_type is added.
* {{spider_db_mbase_util::open_item_func(Item_func *item_func, ...)}} breaks almost every time new {{Item_func::Functype}} is added (e.g., * (other refactoring here) |
{{spider_db_mbase_util::open_item_func()}} is a so-called monster function. It is difficult to maintain while it is expected that we need to modify it when a new SQL function or a new func_type is added.
* {{spider_db_mbase_util::open_item_func(Item_func *item_func, ...)}} breaks almost every time new {{Item_func::Functype}} is added (e.g., * (other refactoring here) |
Link |
This issue is blocked by |
Link |
This issue blocks |
Link |
This issue is blocked by |
Link |
This issue relates to |
Description |
{{spider_db_mbase_util::open_item_func()}} is a so-called monster function. It is difficult to maintain while it is expected that we need to modify it when a new SQL function or a new func_type is added.
* {{spider_db_mbase_util::open_item_func(Item_func *item_func, ...)}} breaks almost every time new {{Item_func::Functype}} is added (e.g., * (other refactoring here) |
{{spider_db_mbase_util::open_item_func()}} is a so-called monster function. It is difficult to maintain while it is expected that we need to modify it when a new SQL function or a new func_type is added.
* {{spider_db_mbase_util::open_item_func(Item_func *item_func, ...)}} breaks almost every time new {{Item_func::Functype}} is added (e.g., * Split the function into two different functions: one handles the case of {{str != NULL}} and the other handles the case of {{str == NULL}}. * (other refactoring here) |
Status | Open [ 1 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | Stalled [ 10000 ] |
Description |
{{spider_db_mbase_util::open_item_func()}} is a so-called monster function. It is difficult to maintain while it is expected that we need to modify it when a new SQL function or a new func_type is added.
* {{spider_db_mbase_util::open_item_func(Item_func *item_func, ...)}} breaks almost every time new {{Item_func::Functype}} is added (e.g., * Split the function into two different functions: one handles the case of {{str != NULL}} and the other handles the case of {{str == NULL}}. * (other refactoring here) |
{{spider_db_mbase_util::open_item_func()}} is a so-called monster function. It is difficult to maintain while it is expected that we need to modify it when a new SQL function or a new func_type is added.
* {{spider_db_mbase_util::open_item_func(Item_func *item_func, ...)}} breaks almost every time new {{Item_func::Functype}} is added (e.g., * Split the function into two different functions: one handles the case of {{str != NULL}} and the other handles the case of {{str == NULL}}. * (other refactoring here) NOTE: You don't need to make everything ideal at once, and it's impossible to do that with complex middleware like databases. Refactor only to the extent that you are sure it is safe to do so without additional unit tests. |
Priority | Major [ 3 ] | Minor [ 4 ] |
Status | Stalled [ 10000 ] | In Progress [ 3 ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Assignee | Nayuta Yanagisawa [ JIRAUSER47117 ] | Sergei Golubchik [ serg ] |
Status | Stalled [ 10000 ] | In Review [ 10002 ] |
Description |
{{spider_db_mbase_util::open_item_func()}} is a so-called monster function. It is difficult to maintain while it is expected that we need to modify it when a new SQL function or a new func_type is added.
* {{spider_db_mbase_util::open_item_func(Item_func *item_func, ...)}} breaks almost every time new {{Item_func::Functype}} is added (e.g., * Split the function into two different functions: one handles the case of {{str != NULL}} and the other handles the case of {{str == NULL}}. * (other refactoring here) NOTE: You don't need to make everything ideal at once, and it's impossible to do that with complex middleware like databases. Refactor only to the extent that you are sure it is safe to do so without additional unit tests. |
{{spider_db_mbase_util::open_item_func()}} is a so-called monster function. It is difficult to maintain while it is expected that we need to modify it when a new SQL function or a new func_type is added.
* -spider_db_mbase_util::open_item_func(Item_func *item_func, ...) breaks almost every time new Item_func::Functyp} is added (e.g., * Split the function into two different functions: one handles the case of {{str != NULL}} and the other handles the case of {{str == NULL}}. NOTE: You don't need to make everything ideal at once, and it's impossible to do that with complex middleware like databases. Refactor only to the extent that you are sure it is safe to do so without additional unit tests. |
Fix Version/s | 10.8 [ 26121 ] | |
Fix Version/s | 10.7 [ 24805 ] |
Workflow | MariaDB v3 [ 124030 ] | MariaDB v4 [ 131783 ] |
Assignee | Sergei Golubchik [ serg ] | Nayuta Yanagisawa [ JIRAUSER47117 ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Fix Version/s | 10.9 [ 26905 ] | |
Fix Version/s | 10.8 [ 26121 ] |
Priority | Minor [ 4 ] | Major [ 3 ] |
Priority | Major [ 3 ] | Minor [ 4 ] |
Fix Version/s | 10.10 [ 27530 ] | |
Fix Version/s | 10.9 [ 26905 ] |
Link |
This issue relates to |
Assignee | Nayuta Yanagisawa [ JIRAUSER47117 ] | Yuchen Pei [ JIRAUSER52627 ] |
Priority | Minor [ 4 ] | Major [ 3 ] |
Link |
This issue blocks |
Link |
This issue relates to |
Priority | Major [ 3 ] | Critical [ 2 ] |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.7 [ 24805 ] | |
Fix Version/s | 10.8 [ 26121 ] | |
Fix Version/s | 10.9 [ 26905 ] | |
Fix Version/s | 10.11 [ 27614 ] |
Assignee | Yuchen Pei [ JIRAUSER52627 ] | Sergei Golubchik [ serg ] |
Status | Stalled [ 10000 ] | In Review [ 10002 ] |
Fix Version/s | N/A [ 14700 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.7 [ 24805 ] | |
Fix Version/s | 10.8 [ 26121 ] | |
Fix Version/s | 10.9 [ 26905 ] | |
Fix Version/s | 10.10 [ 27530 ] | |
Fix Version/s | 10.11 [ 27614 ] | |
Resolution | Duplicate [ 3 ] | |
Status | In Review [ 10002 ] | Closed [ 6 ] |
Comment | [ A comment with security level 'Developers' was removed. ] |
Link | This issue relates to MDEV-30504 [ MDEV-30504 ] |