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

            Transition Time In Source Status Execution Times
            Yuchen Pei made transition -
            Open In Progress
            327d 6h 52m 1
            Yuchen Pei made transition -
            In Progress In Review
            2m 40s 1
            Alexey Botchkov made transition -
            In Review Stalled
            4d 9h 42m 1
            Yuchen Pei made transition -
            Stalled In Testing
            1d 5h 29m 1
            Roel Van de Paar made transition -
            In Testing Stalled
            74d 2h 40m 1
            Yuchen Pei made transition -
            Stalled Closed
            4d 59m 1

            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.