Skip to content
  • Karthik Kamath's avatar
    9d2a5d8a
    BUG#29375764: SIMPLE ALTER CAUSE UNNECESSARY INNODB INDEX · 9d2a5d8a
    Karthik Kamath authored
                  REBUILDS, 5.7.23 OR LATER 5.7 RLSES
    
    ANALYSIS:
    =========
    If a table containing keys on varchar column(s) is created
    prior to 5.7.23, after upgrade to higher 5.7 releases,
    those keys are rebuilt even on a simple ALTER statement to
    add a COMMENT to the table.
    
    If 'PACK_KEYS' table option is not specified, indexes on
    columns with string types are marked for packing through
    'HA_PACK_KEY' flag. 'PACK_KEYS' is supported only for
    MyISAM tables. Before 5.7.23, indexes on columns with
    length greater than 8 bytes were marked for packing
    irrespective of the storage engine. In 5.7.23 and higher
    releases, the key flags 'HA_PACK_KEY' or
    'HA_BINARY_PACK_KEY' are not set if the storage engine
    doesn't support it.
    
    In the bug scenario, a table containing a column of string
    type with length more than 8 bytes is being created in
    5.7.22. Thus the key flag 'HA_PACK_KEY' is set. After
    upgrade to higher 5.7 releases, a simple ALTER statement
    to change the table COMMENT using INPLACE algorithm is
    executed.
    
    For INPLACE algorithm, we compare the changes between the
    original and new table definitions. The result of this
    comparison is then passed to SE which determines whether it
    can carry out these changes in-place. For keys, we check
    if the key types are compatible between old and new
    tables, in 'has_index_def_changed()'. This check finds that
    the key information of the old table has 'HA_PACK_KEY' set
    thus inferring that the index has changed. This information
    is then passed to the SE which recreates the index.
    
    FIX:
    ====
    The flags 'HA_PACK_KEY' or 'HA_BINARY_PACK_KEY' are now
    removed depending on the SE capabilities, while preparing
    the table share for the source table.
    
    Change-Id: I51bd34d04e22b549392ac76411fe64798e8fa96f
    9d2a5d8a
    BUG#29375764: SIMPLE ALTER CAUSE UNNECESSARY INNODB INDEX
    Karthik Kamath authored
                  REBUILDS, 5.7.23 OR LATER 5.7 RLSES
    
    ANALYSIS:
    =========
    If a table containing keys on varchar column(s) is created
    prior to 5.7.23, after upgrade to higher 5.7 releases,
    those keys are rebuilt even on a simple ALTER statement to
    add a COMMENT to the table.
    
    If 'PACK_KEYS' table option is not specified, indexes on
    columns with string types are marked for packing through
    'HA_PACK_KEY' flag. 'PACK_KEYS' is supported only for
    MyISAM tables. Before 5.7.23, indexes on columns with
    length greater than 8 bytes were marked for packing
    irrespective of the storage engine. In 5.7.23 and higher
    releases, the key flags 'HA_PACK_KEY' or
    'HA_BINARY_PACK_KEY' are not set if the storage engine
    doesn't support it.
    
    In the bug scenario, a table containing a column of string
    type with length more than 8 bytes is being created in
    5.7.22. Thus the key flag 'HA_PACK_KEY' is set. After
    upgrade to higher 5.7 releases, a simple ALTER statement
    to change the table COMMENT using INPLACE algorithm is
    executed.
    
    For INPLACE algorithm, we compare the changes between the
    original and new table definitions. The result of this
    comparison is then passed to SE which determines whether it
    can carry out these changes in-place. For keys, we check
    if the key types are compatible between old and new
    tables, in 'has_index_def_changed()'. This check finds that
    the key information of the old table has 'HA_PACK_KEY' set
    thus inferring that the index has changed. This information
    is then passed to the SE which recreates the index.
    
    FIX:
    ====
    The flags 'HA_PACK_KEY' or 'HA_BINARY_PACK_KEY' are now
    removed depending on the SE capabilities, while preparing
    the table share for the source table.
    
    Change-Id: I51bd34d04e22b549392ac76411fe64798e8fa96f
Loading