• Nikita Malyavin's avatar
    MDEV-33348 ALTER TABLE lock waiting stages are indistinguishable · 5d37cac7
    Nikita Malyavin authored
    Several points of synchronization during ALTER TABLE COPY looked identical
    in the progress report query. Besides, if its the late lock upgrade stage,
    the data would be:
    STAGE   0
    MAX_STAGE       0
    PROGRESS        0.000
    
    which looks irrelevant.
    
    This patch moves thd_progress_deinit call after the last lock upgrade.
    
    Also, for online alter, if there is nothing to replicate, the
    progress and max_progress values would be 0, which discard the result data
    on the side of sql_show, see processlist_callback in sql_show.cc.
    So now the minimal max_progress will be 1. To avoid 0% progress in the
    report, minimax progress value is also set to 1, so we will see 100% if
    there's nothing to replicate.
    5d37cac7
sql_table.cc 437 KB