Skip to content
  • Mattias Jonsson's avatar
    1be18f80
    Bug#13029508/62505: ALTER TABLE ADD PARTITION fails for LIST partitions · 1be18f80
    Mattias Jonsson authored
                                          with more than 16 items
    
    Regression from adding COLUMNS partitioning.
    
    When parsing the ALTER TABLE t ADD PARTITION (PARTITION p VALUES IN (...))
    we first allocate a buffer for 16 values, which is the maximum number of columns in
    COLUMNS partitioning.
    If more than 16 values, we conclude that it must be partitioned by a single field
    and it is really a list of single field values and convert it to this in
    partition_info::reorganize_into_single_field_col_val and set the num_columns to 1
    But after this there was no allocation for further elements in add_column_value.
    
    Fixed by
    1) allow reorganize_into_single_field_col_val to reorganize even if the number of
    columns is unknown (assuming that it must be single field).
    2) Before calling add_column_value() after reorganize_into_single_field_col_val()
    is done, call init_column_part() to allocate a new list element.
    
    Also added a few comments to member variables.
    Also changed return type from int to bool for a couple of functions.
    1be18f80
    Bug#13029508/62505: ALTER TABLE ADD PARTITION fails for LIST partitions
    Mattias Jonsson authored
                                          with more than 16 items
    
    Regression from adding COLUMNS partitioning.
    
    When parsing the ALTER TABLE t ADD PARTITION (PARTITION p VALUES IN (...))
    we first allocate a buffer for 16 values, which is the maximum number of columns in
    COLUMNS partitioning.
    If more than 16 values, we conclude that it must be partitioned by a single field
    and it is really a list of single field values and convert it to this in
    partition_info::reorganize_into_single_field_col_val and set the num_columns to 1
    But after this there was no allocation for further elements in add_column_value.
    
    Fixed by
    1) allow reorganize_into_single_field_col_val to reorganize even if the number of
    columns is unknown (assuming that it must be single field).
    2) Before calling add_column_value() after reorganize_into_single_field_col_val()
    is done, call init_column_part() to allocate a new list element.
    
    Also added a few comments to member variables.
    Also changed return type from int to bool for a couple of functions.
Loading