• Marko Mäkelä's avatar
    Bug#12699505 Memory leak in row_create_index_for_mysql() · 8c988dc6
    Marko Mäkelä authored
    DB_COL_APPEARS_TWICE_IN_INDEX: Remove. This condition is already
    checked and reported by MySQL before passing the index definition to
    the storage engine.
    
    row_create_index_for_mysql(): Remove the redundant check for
    DB_COL_APPEARS_TWICE_IN_INDEX. When enforcing the column prefix index
    limit, invoke dict_mem_index_free(index) to plug the memory leak. In
    the loop, use index->n_def instead of dict_index_get_n_fields(index),
    because the latter would be 0 for indexes that have not been copied to
    the data dictionary cache.
    
    innodb-use-sys-malloc.test:
    
    Add test cases for attempting to trigger the error checks in
    row_create_index_for_mysql(). Before MySQL 5.5 and WL#5743, the leak
    is only reproducible if ha_innobase::max_supported_key_part_length()
    returned a higher limit than the one used in
    row_create_index_for_mysql().
    
    In MySQL 5.5 and later, the leak is reproducible with
    innodb_large_prefix=true.
    
    rb:688 approved by Jimmy Yang
    8c988dc6
innodb-use-sys-malloc.result 1.47 KB