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

Factor out code repeat in functions calling spider_check_and_init_casual_read()

Details

    Description

      The following ha_spider methods inside ha_spider.cc call spider_check_and_init_casual_read()

      ft_read_internal multi_range_read_next_first
      index_first_map_internal multi_range_read_next_next
      index_last_internal range_read_first_internal
      index_read_last_map_internal rnd_next_internal
      index_read_map_internal

      Near the callsite is about 80 lines of repeated code. Part of the repeated region is also a common pattern found in other spider files and functions. They need to be factored out.

      See the attached gif for an IDE demo, as well as attached .cc files with these functions extracted out (at 11.0 941f91edbc3d3a0a184b9bfc58d5e4042c4b65f1).

      Attachments

        1. ft_read_internal.cc
          10 kB
        2. index_first_map_internal.cc
          10 kB
        3. index_last_internal.cc
          10 kB
        4. index_read_last_map_internal.cc
          10 kB
        5. index_read_map_internal.cc
          10 kB
        6. multi_range_read_next_first.cc
          38 kB
        7. multi_range_read_next_next.cc
          37 kB
        8. range_read_first_internal.cc
          10 kB
        9. rnd_next_internal.cc
          11 kB
        10. screen.gif
          screen.gif
          2.03 MB

        Issue Links

          Activity

            ycp Yuchen Pei created issue -
            ycp Yuchen Pei made changes -
            Field Original Value New Value
            ycp Yuchen Pei made changes -
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.9 [ 26905 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 10.10 [ 27530 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 11.0 [ 28320 ]
            ycp Yuchen Pei made changes -
            Fix Version/s 10.4 [ 22408 ]
            ycp Yuchen Pei made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            ycp Yuchen Pei made changes -
            Assignee Yuchen Pei [ JIRAUSER52627 ] Alexey Botchkov [ holyfoot ]
            Status In Progress [ 3 ] In Review [ 10002 ]
            holyfoot Alexey Botchkov made changes -
            Assignee Alexey Botchkov [ holyfoot ] Yuchen Pei [ JIRAUSER52627 ]
            Status In Review [ 10002 ] Stalled [ 10000 ]
            ycp Yuchen Pei made changes -
            Status Stalled [ 10000 ] In Testing [ 10301 ]
            ycp Yuchen Pei made changes -
            Assignee Yuchen Pei [ JIRAUSER52627 ] Roel Van de Paar [ roel ]
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            Roel Roel Van de Paar made changes -
            Assignee Roel Van de Paar [ roel ] Yuchen Pei [ JIRAUSER52627 ]
            Status In Testing [ 10301 ] Stalled [ 10000 ]
            julien.fritsch Julien Fritsch made changes -
            Fix Version/s 11.1 [ 28549 ]
            ycp Yuchen Pei made changes -
            Fix Version/s 10.5.27 [ 29902 ]
            Fix Version/s 10.5 [ 23123 ]
            Fix Version/s 10.6 [ 24028 ]
            Fix Version/s 10.11 [ 27614 ]
            Fix Version/s 11.2 [ 28603 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]

            People

              ycp Yuchen Pei
              ycp Yuchen Pei
              Votes:
              1 Vote for this issue
              Watchers:
              6 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.