Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-4372

Simplify struct PartitionInfo in ha_mcs_partition.cpp

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 1.5.3, 6.1.1
    • 23.10
    • N/A
    • None

    Description

      struct PartitionInfo seems to have some redundancy:

      struct PartitionInfo
      {
          int64_t min;
          int64_t max;
          union
          {
              int128_t int128Min;
              int64_t min_;
          };
          union
          {
              int128_t int128Max;
              int64_t max_;
          };
          uint64_t status;
          ....
      };
      

      It's not clear why have two int64_t members for "min" and two int64_t members for "max".
      Either of them should be removed.

      Also, to avoid casts, we could add members for unsigned variants.

      Something like this should do:

      union PartitionValue
      {
        int64_t m_sint64;
        uint64_t m_uint64;
        int128_t m_sint128;
      };
       
      struct PartitionInfo
      {
        PartitionValue m_min;
        PartitionValue m_max;
        uint64_t m_status;
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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