-
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:
Jimmy Yang <jimmy.yang@oracle.com>
Bin Su authoredThe 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:
Jimmy Yang <jimmy.yang@oracle.com>
Loading