Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-26285

Refactor spider_db_mbase_util::open_item_func()

Details

    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

          Activity

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) created issue -
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            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()
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            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.
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            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., MDEV-24760, MDEV-24517). A possible solution would be removeing the default case and enable {{-Wswitch}}.
            * (other refactoring here)
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            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., MDEV-24760, MDEV-24517). A possible solution would be removeing the default case and enable {{-Wswitch}}.
            * (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., MDEV-24760, MDEV-24517). A possible solution would be removeing the default case and enable {{-Wswitch}}.
            * (other refactoring here)
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Component/s Storage Engine - Spider [ 10132 ]
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Epic Link MDEV-26286 [ 101691 ]
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            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., MDEV-24760, MDEV-24517). A possible solution would be removeing the default case and enable {{-Wswitch}}.
            * (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., MDEV-24760, MDEV-24517). A possible solution would be removeing the default case and enable {{-Wswitch}}.
            * (other refactoring here)
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            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., MDEV-24760, MDEV-24517). A possible solution would be removeing the default case and enable {{-Wswitch}}.
            * (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., 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}}.
            * (other refactoring here)
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            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., 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}}.
            * (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., 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}}.
            * (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.
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Priority Major [ 3 ] Minor [ 4 ]
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Status Stalled [ 10000 ] In Progress [ 3 ]

            serg Please review the following patch. I refactored a little conservatively. Actually, I tried further refactoring but I noticed that it was too dangerous. https://github.com/MariaDB/server/commit/fa8a4a33c71807f37429c70e358b46c1f0aaf7c2

            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - serg Please review the following patch. I refactored a little conservatively. Actually, I tried further refactoring but I noticed that it was too dangerous. https://github.com/MariaDB/server/commit/fa8a4a33c71807f37429c70e358b46c1f0aaf7c2
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Status In Progress [ 3 ] In Review [ 10002 ]
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Assignee Nayuta Yanagisawa [ JIRAUSER47117 ] Sergei Golubchik [ serg ]
            Status Stalled [ 10000 ] In Review [ 10002 ]
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) added a comment - - edited serg Let me replace the patch. Please review this one. https://github.com/MariaDB/server/commit/3836098c29ef1b7ff9d5fbde99b690eab73a0df1
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            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., 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}}.
            * (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., 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.
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.8 [ 26121 ]
            Fix Version/s 10.7 [ 24805 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 124030 ] MariaDB v4 [ 131783 ]
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Assignee Sergei Golubchik [ serg ] Nayuta Yanagisawa [ JIRAUSER47117 ]
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Status In Review [ 10002 ] Stalled [ 10000 ]
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Fix Version/s 10.9 [ 26905 ]
            Fix Version/s 10.8 [ 26121 ]
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Priority Minor [ 4 ] Major [ 3 ]
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Priority Major [ 3 ] Minor [ 4 ]
            nayuta-yanagisawa Nayuta Yanagisawa (Inactive) made changes -
            Fix Version/s 10.10 [ 27530 ]
            Fix Version/s 10.9 [ 26905 ]
            ycp Yuchen Pei made changes -
            ycp Yuchen Pei made changes -
            Assignee Nayuta Yanagisawa [ JIRAUSER47117 ] Yuchen Pei [ JIRAUSER52627 ]
            ycp Yuchen Pei made changes -
            Priority Minor [ 4 ] Major [ 3 ]
            ycp Yuchen Pei added a comment -

            Bumped priority as a refactoring will fix MDEV-29447.

            ycp Yuchen Pei added a comment - Bumped priority as a refactoring will fix MDEV-29447 .
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            julien.fritsch Julien Fritsch made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            serg Sergei Golubchik made changes -
            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 ]
            serg Sergei Golubchik made changes -
            Assignee Yuchen Pei [ JIRAUSER52627 ] Sergei Golubchik [ serg ]
            serg Sergei Golubchik made changes -
            Status Stalled [ 10000 ] In Review [ 10002 ]

            The review of this patch is done in MDEV-29447

            serg Sergei Golubchik added a comment - The review of this patch is done in MDEV-29447
            serg Sergei Golubchik made changes -
            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 ]
            serg Sergei Golubchik made changes -
            Comment [ A comment with security level 'Developers' was removed. ]
            ycp Yuchen Pei made changes -

            People

              serg Sergei Golubchik
              nayuta-yanagisawa Nayuta Yanagisawa (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.