[MCOL-4372] Simplify struct PartitionInfo in ha_mcs_partition.cpp Created: 2020-10-29  Updated: 2023-07-01

Status: Open
Project: MariaDB ColumnStore
Component/s: N/A
Affects Version/s: 1.5.3, 6.1.1
Fix Version/s: 23.10

Type: Task Priority: Minor
Reporter: Alexander Barkov Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: 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;
}


Generated at Thu Feb 08 02:49:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.