Skip to content
  • Bin Su's avatar
    e786c28d
    BUG#27603025 - ROLLBACK OF TRUNCATE PARTITION DOESN'T WORK · e786c28d
    Bin Su authored
    
    
    The problem is that during 'ALTER TABLE .. TRUNCATE PARTITION ...',
    server will keep a handler open, and ask SE to do the real truncation,
    however, it's quite difficult for SE to handle errors if SE is
    truncating the partition in the DROP+CREATE way. If there is error after
    SE dropped one or more partitions, there is no easy way to re-open the
    whole table.
    
    So the solution is that close all handlers before diving into SE to
    truncate partitions, and let SE to open and manage each partition.
    
    This patch also cleans up some related code, and another bug gets fixed
    too is that truncating some partitions will not affect current
    AUTO_INCREMENT value, even if the partition containing the max value
    is truncated. So only truncate the whole table will reset the
    AUTO_INCREMENT value to 0, otherwise, it should be kept as is.
    
    RB: 19371
    Reviewed-by: default avatarJimmy Yang <jimmy.yang@oracle.com>
    e786c28d
    BUG#27603025 - ROLLBACK OF TRUNCATE PARTITION DOESN'T WORK
    Bin Su authored
    
    
    The problem is that during 'ALTER TABLE .. TRUNCATE PARTITION ...',
    server will keep a handler open, and ask SE to do the real truncation,
    however, it's quite difficult for SE to handle errors if SE is
    truncating the partition in the DROP+CREATE way. If there is error after
    SE dropped one or more partitions, there is no easy way to re-open the
    whole table.
    
    So the solution is that close all handlers before diving into SE to
    truncate partitions, and let SE to open and manage each partition.
    
    This patch also cleans up some related code, and another bug gets fixed
    too is that truncating some partitions will not affect current
    AUTO_INCREMENT value, even if the partition containing the max value
    is truncated. So only truncate the whole table will reset the
    AUTO_INCREMENT value to 0, otherwise, it should be kept as is.
    
    RB: 19371
    Reviewed-by: default avatarJimmy Yang <jimmy.yang@oracle.com>
Loading